Re: [PATCH RFC v3 for-6.8/block 02/17] xen/blkback: use bdev api in xen_update_blkif_status()

2024-01-04 Thread Jan Kara
Hi Kuai! On Thu 04-01-24 20:19:05, Yu Kuai wrote: > 在 2024/01/04 19:06, Jan Kara 写道: > > On Thu 21-12-23 16:56:57, Yu Kuai wrote: > > > From: Yu Kuai > > > > > > Avoid to access bd_inode directly, prepare to remove bd_inode from > > > bloc

Re: [PATCH RFC v3 for-6.8/block 14/17] buffer: add a new helper to read sb block

2024-01-04 Thread Jan Kara
4), and prepare to > prevent calling mapping_gfp_constraint() directly on bd_inode->i_mapping > in ext4. > > Signed-off-by: Yu Kuai I'm not enthusiastic about this but I guess it is as good as it gets without larger cleanups in thi

Re: [PATCH RFC v3 for-6.8/block 13/17] jbd2: use bdev apis

2024-01-04 Thread Jan Kara
On Thu 21-12-23 16:58:46, Yu Kuai wrote: > From: Yu Kuai > > Avoid to access bd_inode directly, prepare to remove bd_inode from > block_device. > > Signed-off-by: Yu Kuai Looks good to me. Feel free to add: Reviewed-by: Jan Kara But note there are changes pe

Re: [PATCH RFC v3 for-6.8/block 11/17] erofs: use bdev api

2024-01-04 Thread Jan Kara
0409badb017..c9206351b485 100644 > --- a/fs/erofs/internal.h > +++ b/fs/erofs/internal.h > @@ -224,8 +224,10 @@ enum erofs_kmap_type { > > struct erofs_buf { > struct inode *inode; > + struct block_device *bdev; > struct page *page; > void *base; > + u8 blkszbits; > enum erofs_kmap_type kmap_type; > }; > #define __EROFS_BUF_INITIALIZER ((struct erofs_buf){ .page = NULL }) > -- > 2.39.2 > -- Jan Kara SUSE Labs, CR

Re: [PATCH RFC v3 for-6.8/block 09/17] btrfs: use bdev apis

2024-01-04 Thread Jan Kara
developers know and maybe it is just a cargo cult. And it is not like this would be the first occurence of this anti-pattern in btrfs - see e.g. device_list_add(), add_missing_dev(), btrfs_destroy_delalloc_inodes() (here the wrapping around invalidate_inode_pages2() looks really weird), and many others... Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH RFC v3 for-6.8/block 04/17] mtd: block2mtd: use bdev apis

2024-01-04 Thread Jan Kara
n we are working with the folios it is rather natural to use their mapping for dirty balancing? Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH RFC v3 for-6.8/block 02/17] xen/blkback: use bdev api in xen_update_blkif_status()

2024-01-04 Thread Jan Kara
lean dirty pages using the ->launder_folio method). So I think you'll need helper like invalidate_bdev2() for this. Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH RFC v2 for-6.8/block 15/18] buffer: add a new helper to read sb block

2023-12-12 Thread Jan Kara
n on doing ;) Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH RFC v2 for-6.8/block 15/18] buffer: add a new helper to read sb block

2023-12-11 Thread Jan Kara
gfp, true); > +} > +EXPORT_SYMBOL(__bread_gfp2); __bread_gfp2() is not a great name, why not just using bread_gfp() directly? I'm not a huge fan of boolean arguments but three different flags arguments would be too much for my taste ;) so I guess I can live with that. Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH RFC v2 for-6.8/block 16/18] ext4: use new helper to read sb block

2023-12-11 Thread Jan Kara
ree to add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/ext4.h| 13 - > fs/ext4/inode.c | 8 > fs/ext4/super.c | 45 ++--- > fs/ext4/syml

Re: [PATCH RFC v2 for-6.8/block 17/18] ext4: remove block_device_ejected()

2023-12-11 Thread Jan Kara
reed, this should not be needed anymore. We'll see whether this is true also in practice :). Feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH RFC v2 for-6.8/block 18/18] ext4: use bdev apis

2023-12-11 Thread Jan Kara
On Mon 11-12-23 22:08:39, Yu Kuai wrote: > From: Yu Kuai > > Avoid to access bd_inode directly, prepare to remove bd_inode from > block_devcie. ^^^ device > Signed-off-by: Yu Kuai Looks good. Feel free to add: Review

Re: [PATCH RFC v2 for-6.8/block 01/18] block: add some bdev apis

2023-12-11 Thread Jan Kara
Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH v4 0/29] block: Make blkdev_get_by_*() return handle

2023-10-02 Thread Jan Kara
On Wed 27-09-23 18:21:19, Christian Brauner wrote: > On Wed, 27 Sep 2023 11:34:07 +0200, Jan Kara wrote: > > Create struct bdev_handle that contains all parameters that need to be > > passed to blkdev_put() and provide bdev_open_* functions that return > > this structure

[PATCH 21/29] erofs: Convert to use bdev_open_by_path()

2023-09-27 Thread Jan Kara
Convert erofs to use bdev_open_by_path() and pass the handle around. CC: Gao Xiang CC: Chao Yu CC: linux-erofs@lists.ozlabs.org Acked-by: Christoph Hellwig Acked-by: Gao Xiang Reviewed-by: Christian Brauner Signed-off-by: Jan Kara --- fs/erofs/data.c | 4 ++-- fs/erofs/internal.h | 2

Re: [PATCH v7 12/13] ext4: switch to multigrain timestamps

2023-09-20 Thread Jan Kara
On Wed 20-09-23 10:12:03, Jeff Layton wrote: > On Wed, 2023-09-20 at 14:48 +0200, Jan Kara wrote: > > On Wed 20-09-23 06:35:18, Jeff Layton wrote: > > > On Wed, 2023-09-20 at 12:17 +0200, Jan Kara wrote: > > > > If I were a sysadmin, I'd rather opt for something like

Re: [PATCH v7 12/13] ext4: switch to multigrain timestamps

2023-09-20 Thread Jan Kara
for multigrain timestamps") will be needed anyway but there's no problem in reintroducing it in the new solution. I've checked the branch and the reverts look good to me. Feel free to add: Acked-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH v7 12/13] ext4: switch to multigrain timestamps

2023-09-20 Thread Jan Kara
On Wed 20-09-23 06:35:18, Jeff Layton wrote: > On Wed, 2023-09-20 at 12:17 +0200, Jan Kara wrote: > > If I were a sysadmin, I'd rather opt for something like > > finegrained timestamps + lazytime (if I needed the finegrained timestamps > > functionality). That should

Re: [PATCH v7 12/13] ext4: switch to multigrain timestamps

2023-09-20 Thread Jan Kara
ine SB_MGTIMEBIT(5) /* Use multi-grain timestamps */ > #define SB_MANDLOCK BIT(6) /* Allow mandatory locks on an FS */ > #define SB_DIRSYNC BIT(7) /* Directory modifications are > synchronous */ > #define SB_NOATIME BIT(10) /* Do not update access ti

Re: [PATCH v7 12/13] ext4: switch to multigrain timestamps

2023-09-20 Thread Jan Kara
stant, and that > > > isn't necessarily the case now. > > > > This is only of secondary importance, because the scenario by Jan Kara > > shows a much more fundamental breakage: > > > > > > The ultimate problem is that a sequence like: > > > > &g

Re: [PATCH v7 12/13] ext4: switch to multigrain timestamps

2023-09-19 Thread Jan Kara
t(f1) can result in f1 timestamp to be (slightly) lower than the final f2 timestamp because the second write to f1 didn't bother updating the timestamp. That can indeed be a bit confusing to programs if they compare timestamps between two files. Jeff?

Re: [PATCH v3 0/29] block: Make blkdev_get_by_*() return handle

2023-08-28 Thread Jan Kara
On Fri 25-08-23 15:32:47, Christian Brauner wrote: > On Wed, Aug 23, 2023 at 12:48:11PM +0200, Jan Kara wrote: > > Hello, > > > > this is a v3 of the patch series which implements the idea of > > blkdev_get_by_*() > > calls returning bdev_handle which

Re: [PATCH v2 0/29] block: Make blkdev_get_by_*() return handle

2023-08-25 Thread Jan Kara
On Fri 25-08-23 02:58:43, Al Viro wrote: > On Fri, Aug 11, 2023 at 01:04:31PM +0200, Jan Kara wrote: > > Hello, > > > > this is a v2 of the patch series which implements the idea of > > blkdev_get_by_*() > > calls returning bdev_handle which is then passed to

[PATCH v3 0/29] block: Make blkdev_get_by_*() return handle

2023-08-23 Thread Jan Kara
Hello, this is a v3 of the patch series which implements the idea of blkdev_get_by_*() calls returning bdev_handle which is then passed to blkdev_put() [1]. This makes the get and put calls for bdevs more obviously matching and allows us to propagate context from get to put without having to

[PATCH 21/29] erofs: Convert to use bdev_open_by_path()

2023-08-23 Thread Jan Kara
Convert erofs to use bdev_open_by_path() and pass the handle around. CC: Gao Xiang CC: Chao Yu CC: linux-erofs@lists.ozlabs.org Acked-by: Christoph Hellwig Acked-by: Gao Xiang Signed-off-by: Jan Kara --- fs/erofs/data.c | 4 ++-- fs/erofs/internal.h | 2 +- fs/erofs/super.c| 20

[PATCH 21/29] erofs: Convert to use bdev_open_by_path()

2023-08-11 Thread Jan Kara
Convert erofs to use bdev_open_by_path() and pass the handle around. CC: Gao Xiang CC: Chao Yu CC: linux-erofs@lists.ozlabs.org Acked-by: Gao Xiang Signed-off-by: Jan Kara --- fs/erofs/data.c | 4 ++-- fs/erofs/internal.h | 2 +- fs/erofs/super.c| 20 ++-- 3 files

[PATCH v2 0/29] block: Make blkdev_get_by_*() return handle

2023-08-11 Thread Jan Kara
Hello, this is a v2 of the patch series which implements the idea of blkdev_get_by_*() calls returning bdev_handle which is then passed to blkdev_put() [1]. This makes the get and put calls for bdevs more obviously matching and allows us to propagate context from get to put without having to

Re: [PATCH v7 06/13] ubifs: have ubifs_update_time use inode_update_timestamps

2023-08-09 Thread Jan Kara
On Wed 09-08-23 09:06:34, Christian Brauner wrote: > On Tue, Aug 08, 2023 at 11:37:01AM +0200, Jan Kara wrote: > > On Mon 07-08-23 15:38:37, Jeff Layton wrote: > > > In later patches, we're going to drop the "now" parameter from the > > > update_time operati

Re: [PATCH v7 13/13] btrfs: convert to multigrain timestamps

2023-08-08 Thread Jan Kara
atch eliminates > update_time_for_write, which goes to great pains to avoid in-memory > stores. Just have it overwrite the timestamps unconditionally. > > Signed-off-by: Jeff Layton > Acked-by: David Sterba Looks good to me. Feel free

Re: [PATCH v7 09/13] fs: add infrastructure for multigrain timestamps

2023-08-08 Thread Jan Kara
ms that don't set this flag will continue to use > coarse-grained timestamps. > > Later patches will convert individual filesystems to use the new > infrastructure. > > Signed-off-by: Jeff Layton Looks good to me. Feel free to add: Reviewed-by:

Re: [PATCH v7 07/13] xfs: have xfs_vn_update_time gets its own timestamp

2023-08-08 Thread Jan Kara
(flags & S_ATIME) > - inode->i_atime = *now; > + inode->i_atime = now; > > xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); > xfs_trans_log_inode(tp, ip, log_flags); Otherwise the patch looks good to me so feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH v7 06/13] ubifs: have ubifs_update_time use inode_update_timestamps

2023-08-08 Thread Jan Kara
calling __mark_inode_dirty(). Otherwise you could release budget for inode update you really need... > if (release) > ubifs_release_budget(c, ); Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH v7 05/13] fat: make fat_update_time get its own timestamp

2023-08-08 Thread Jan Kara
Signed-off-by: Jeff Layton Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/fat/misc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/fat/misc.c b/fs/fat/misc

Re: [PATCH v7 04/13] btrfs: have it use inode_update_timestamps

2023-08-08 Thread Jan Kara
d-off-by: Jeff Layton Nice cleanup! Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/btrfs/inode.c | 9 + > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/fs/btrfs/inode.c b/fs/btrfs

Re: [PATCH v7 03/13] fs: drop the timespec64 arg from generic_update_time

2023-08-08 Thread Jan Kara
hat and rework the callers to expect it. > > Signed-off-by: Jeff Layton Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/gfs2/inode.c | 3 +- > fs/inode.c | 84 > +++

Re: [PATCH v7 01/13] fs: remove silly warning from current_time

2023-08-08 Thread Jan Kara
On Mon 07-08-23 15:38:32, Jeff Layton wrote: > An inode with no superblock? Unpossible! > > Signed-off-by: Jeff Layton Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/inode.c | 6 -- &g

Re: [PATCH v6 6/7] ext4: switch to multigrain timestamps

2023-08-02 Thread Jan Kara
> > Signed-off-by: Jeff Layton Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/super.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ext4/super.c b/

Re: [PATCH v6 4/7] tmpfs: add support for multigrain timestamps

2023-08-02 Thread Jan Kara
; Signed-off-by: Jeff Layton Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > mm/shmem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/shmem.c b/mm/shmem.c > index 654d9

Re: [PATCH v6 2/7] fs: add infrastructure for multigrain timestamps

2023-08-02 Thread Jan Kara
32768 /* FS will handle d_move() > during rename() internally. */ > int (*init_fs_context)(struct fs_context *); > const struct fs_parameter_spec *parameters; > @@ -2284,6 +2313,17 @@ struct file_system_type { > > #define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-&

Re: [PATCH v6 1/7] fs: pass the request_mask to generic_fillattr

2023-08-02 Thread Jan Kara
ng of > STATX_CHANGE_COOKIE into generic_fillattr. > > Signed-off-by: Jeff Layton Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/9p/vfs_inode.c | 4 ++-- > fs/9p/vfs_inode_dotl.c | 4 ++-- > fs/

Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-07 Thread Jan Kara
On Fri 07-07-23 04:28:41, Christoph Hellwig wrote: > On Thu, Jul 06, 2023 at 06:14:33PM +0200, Jan Kara wrote: > > > struct bdev_handle *bdev_open_by_path(dev_t dev, blk_mode_t mode, > > > void *holder, const struct blk_holder_ops *hops); > > > void b

Re: [PATCH v2 92/92] fs: rename i_ctime field to __i_ctime

2023-07-06 Thread Jan Kara
On Wed 05-07-23 14:58:12, Jeff Layton wrote: > Now that everything in-tree is converted to use the accessor functions, > rename the i_ctime field in the inode to discourage direct access. > > Signed-off-by: Jeff Layton Looks good. Feel free to add: Reviewed-

Re: [PATCH v2 08/92] fs: new helper: simple_rename_timestamp

2023-07-06 Thread Jan Kara
struct inode *, struct dentry *); > extern int simple_unlink(struct inode *, struct dentry *); > extern int simple_rmdir(struct inode *, struct dentry *); > +void simple_rename_timestamp(struct inode *old_dir, struct dentry > *old_dentry, > + struct inode *new_dir, struct dentry *new_dentry); > extern int simple_rename_exchange(struct inode *old_dir, struct dentry > *old_dentry, > struct inode *new_dir, struct dentry > *new_dentry); > extern int simple_rename(struct mnt_idmap *, struct inode *, > -- > 2.41.0 > -- Jan Kara SUSE Labs, CR

Re: [PATCH v2 39/92] erofs: convert to ctime accessor functions

2023-07-06 Thread Jan Kara
+ inode->i_atime.tv_sec = inode_get_ctime(inode).tv_sec; > + inode->i_mtime.tv_nsec = inode_get_ctime(inode).tv_nsec; > + inode->i_atime.tv_nsec = inode_get_ctime(inode).tv_nsec; Isn't this just longer way to write: inode->i_atime = inode->i_mtime = inode_get_ctime(inode); ? Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-05 Thread Jan Kara
On Tue 04-07-23 07:06:26, Bart Van Assche wrote: > On 7/4/23 05:21, Jan Kara wrote: > > +struct bdev_handle { > > + struct block_device *bdev; > > + void *holder; > > +}; > > Please explain in the patch description why a holder pointer is introduced > in s

Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-05 Thread Jan Kara
On Tue 04-07-23 10:28:36, Keith Busch wrote: > On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > > +struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode, > > + void *holder, const struct blk_holder_ops *hops) > > +{ > > +

Re: [PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-04 Thread Jan Kara
On Tue 04-07-23 13:43:51, Matthew Wilcox wrote: > On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > > +struct bdev_handle *blkdev_get_handle_by_dev(dev_t dev, blk_mode_t mode, > > + void *holder, const struct blk_holder_ops *hops) > > +{ > > +

[PATCH 22/32] erofs: Convert to use blkdev_get_handle_by_path()

2023-07-04 Thread Jan Kara
Convert erofs to use blkdev_get_handle_by_path() and pass the handle around. CC: Gao Xiang CC: Chao Yu CC: linux-erofs@lists.ozlabs.org Signed-off-by: Jan Kara --- fs/erofs/data.c | 4 ++-- fs/erofs/internal.h | 2 +- fs/erofs/super.c| 20 ++-- 3 files changed, 13

[PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-04 Thread Jan Kara
eiserfs-de...@vger.kernel.org CC: Sergey Senozhatsky CC: Song Liu CC: Sven Schnelle CC: target-de...@vger.kernel.org CC: Ted Tso CC: Trond Myklebust CC: xen-de...@lists.xenproject.org Signed-off-by: Jan Kara --- block/bdev.c | 47 ++ include/linu

[PATCH 32/32] block: Rename blkdev_get_handle_by_*() and blkdev_handle_put()

2023-07-04 Thread Jan Kara
C: Minchan Kim CC: ocfs2-de...@oss.oracle.com CC: reiserfs-de...@vger.kernel.org CC: Sergey Senozhatsky CC: Song Liu CC: Sven Schnelle CC: target-de...@vger.kernel.org CC: Ted Tso CC: Trond Myklebust CC: xen-de...@lists.xenproject.org Signed-off-by: Jan Kara --- bl

[PATCH RFC 0/32] block: Make blkdev_get_by_*() return handle

2023-07-04 Thread Jan Kara
Hello, this patch series implements the idea of blkdev_get_by_*() calls returning bdev_handle which is then passed to blkdev_put() [1]. This makes the get and put calls for bdevs more obviously matching and allows us to propagate context from get to put without having to modify all the users

Re: [PATCH 01/79] fs: add ctime accessors infrastructure

2023-06-21 Thread Jan Kara
do that safely though, we'll need to eradicate raw > accesses of the inode->i_ctime field from the kernel. > > Add new accessor functions for the ctime that we can use to replace them. > > Signed-off-by: Jeff Layton Looks good to me. Feel fr

Re: Readahead for compressed data

2021-10-22 Thread Jan Kara
h of complexity. That being said keeping compressed data cached somewhere else than in the page cache may certainly me worth it and then just filling page cache on demand from this data... Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH v15 1/4] Add flags option to get xattr method paired to __vfs_getxattr

2019-11-05 Thread Jan Kara
%u", yacl->num_cleaned); > break; > case 3: These scnprintf() changes (and there are more in the patch) probably shouldn't be here... Otherwise the patch still looks good to me :). Honza -- Jan Kara SUSE Labs, CR

Re: [PATCH v7] Add flags option to get xattr method paired to __vfs_getxattr

2019-08-27 Thread Jan Kara
> + int (*get)(const struct xattr_handler *handler, > +struct xattr_gs_flags); > + int (*set)(const struct xattr_handler *handler, > +struct xattr_gs_flags); The prototype here is really "struct xattr_gs_flags *args", isn't it? Othe

Re: [PATCH v4] Add flags option to get xattr method paired to __vfs_getxattr

2019-08-16 Thread Jan Kara
of the > flags option for xattr functions, and a replacement of _vfs_getxattr > with __vfs_getxattr(...XATTR_NOSECURITY). > > Signed-off-by: Mark Salyzyn > Cc: Stephen Smalley > Cc: linux-ker...@vger.kernel.org > Cc: kernel-t...@android.com > Cc: linux-security-mod...@vger.ke

Re: [PATCH v2] Add flags option to get xattr method paired to __vfs_getxattr

2019-08-15 Thread Jan Kara
On Wed 14-08-19 07:54:16, Mark Salyzyn wrote: > On 8/14/19 4:00 AM, Jan Kara wrote: > > On Tue 13-08-19 07:55:06, Mark Salyzyn wrote: > > ... > > > diff --git a/fs/xattr.c b/fs/xattr.c > > > index 90dd78f0eb27..71f887518d6f 100644 > > &g

Re: [PATCH v2] Add flags option to get xattr method paired to __vfs_getxattr

2019-08-14 Thread Jan Kara
ing to export XATTR_NOSECURITY definition to userspace when that is kernel-internal flag. I'd just define it in include/linux/xattr.h somewhere from the top of flags space (like 0x4000). Otherwise the patch looks OK to me (cannot really comment on the security module aspect of this whole thing though). Honza -- Jan Kara SUSE Labs, CR