Re: [f2fs-dev] [syzbot] [f2fs?] WARNING in rcu_sync_dtor

2024-07-30 Thread Jan Kara
On Mon 29-07-24 09:58:47, Theodore Ts'o wrote: > On Mon, Jul 29, 2024 at 03:27:21PM +0200, Jan Kara wrote: > > So in ext4 we have EXT4_FLAGS_SHUTDOWN flag which we now use > > internally instead of SB_RDONLY flag for checking whether the > > filesystem was shutdown (because ot

Re: [f2fs-dev] [syzbot] [f2fs?] WARNING in rcu_sync_dtor

2024-07-29 Thread Jan Kara
e filesystems, I'm playing with the idea that maybe we could lift a flag like this to VFS so that we can check it in VFS paths and abort some operations early. But so far I'm not convinced the gain is worth the need to iron out various subtle semantical differences of "shutdown" among files

Re: [f2fs-dev] [PATCH v3 10/13] ocfs2: fiemap: return correct extent physical length

2024-04-03 Thread Jan Kara
> if (rec.e_flags & OCFS2_EXT_UNWRITTEN) > fe_flags |= FIEMAP_EXTENT_UNWRITTEN; > if (rec.e_flags & OCFS2_EXT_REFCOUNTED) Again, we should be passing non-zero phys_len if we set FIEMAP_EXTENT_HAS_PHYS_LEN flag A

Re: [f2fs-dev] [PATCH v3 07/13] ext4: fiemap: return correct extent physical length

2024-04-03 Thread Jan Kara
N; OK, but we should then pass (__u64)es.es_len << blksize_bits as physical extent length below, shouldn't we? > if (!ext4_es_lookup_extent(inode, block, , )) > break; > if (ext4_es_is_unwritten())

Re: [f2fs-dev] [syzbot] [reiserfs?] possible deadlock in super_lock

2024-01-02 Thread Jan Kara
On Thu 28-12-23 11:50:32, Christian Brauner wrote: > On Sun, Dec 24, 2023 at 08:40:05AM -0800, syzbot wrote: > > syzbot suspects this issue was fixed by commit: > > > > commit fd1464105cb37a3b50a72c1d2902e97a71950af8 > > Author: Jan Kara > > Date: Wed Oct 18 15

Re: [f2fs-dev] [PATCH] f2fs: fix to avoid dirent corruption

2023-11-28 Thread Jan Kara
-> Bad inode number[0x4] for '..', > parent parent ino is [0x3] > [FSCK] other corrupted bugs [Fail] > > Fixes: 7e01e7ad746b ("f2fs: support RENAME_WHITEOUT") > Cc: Jan Kara > Reported-

Re: [f2fs-dev] [RFC] weirdness in f2fs_rename() with RENAME_WHITEOUT

2023-10-26 Thread Jan Kara
_bh) { > retval = ext4_rename_dir_finish(handle, , new.dir->i_ino); > and old.dir_bh is set by > retval = ext4_rename_dir_prepare(handle, ); > a few lines prior, which is not conditional upon the whiteout. > > What am I missing there? -- Jan Kara S

Re: [f2fs-dev] [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

[f2fs-dev] [PATCH 23/29] f2fs: Convert to bdev_open_by_dev/path()

2023-09-27 Thread Jan Kara
Convert f2fs to use bdev_open_by_dev/path() and pass the handle around. CC: Jaegeuk Kim CC: Chao Yu CC: linux-f2fs-devel@lists.sourceforge.net Acked-by: Christoph Hellwig Reviewed-by: Christian Brauner Signed-off-by: Jan Kara --- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 13 +++-- 2

Re: [f2fs-dev] [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: [f2fs-dev] [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 L

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

2023-09-20 Thread Jan Kara
On Wed 20-09-23 12:30:52, Christian Brauner wrote: > On Wed, Sep 20, 2023 at 12:17:31PM +0200, Jan Kara wrote: > > On Wed 20-09-23 10:41:30, Christian Brauner wrote: > > > > > f1 was last written to *after* f2 was last written to. If the > > > > > times

Re: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [PATCH] quota: explicitly forbid quota files from being encrypted

2023-09-05 Thread Jan Kara
ota files are cleaned up later than user files. > + */ > + if (IS_ENCRYPTED(inode)) > + return -EINVAL; > + > dqopt->files[type] = igrab(inode); > if (!dqopt->files[type]) > return -EIO; > > base-commit: 708283abf896dd4

Re: [f2fs-dev] [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: [f2fs-dev] [PATCH 23/29] f2fs: Convert to bdev_open_by_dev/path()

2023-08-28 Thread Jan Kara
On Mon 28-08-23 20:57:53, Chao Yu wrote: > On 2023/8/23 18:48, Jan Kara wrote: > > Convert f2fs to use bdev_open_by_dev/path() and pass the handle around. > > Hi Jan, > > Seems it will confilct w/ below commit, could you please take a look? > > https://git.kernel.o

Re: [f2fs-dev] [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

[f2fs-dev] [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

[f2fs-dev] [PATCH 23/29] f2fs: Convert to bdev_open_by_dev/path()

2023-08-23 Thread Jan Kara
Convert f2fs to use bdev_open_by_dev/path() and pass the handle around. CC: Jaegeuk Kim CC: Chao Yu CC: linux-f2fs-devel@lists.sourceforge.net Acked-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 17 + 2 files changed, 10

[f2fs-dev] [PATCH 23/29] f2fs: Convert to bdev_open_by_dev/path()

2023-08-11 Thread Jan Kara
Convert f2fs to use bdev_open_by_dev/path() and pass the handle around. CC: Jaegeuk Kim CC: Chao Yu CC: linux-f2fs-devel@lists.sourceforge.net Signed-off-by: Jan Kara --- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 17 + 2 files changed, 10 insertions(+), 8 deletions(-) diff

[f2fs-dev] [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: [f2fs-dev] [PATCH 02/12] nilfs2: use setup_bdev_super to de-duplicate the mount code

2023-08-10 Thread Jan Kara
On Fri 11-08-23 01:39:10, Ryusuke Konishi wrote: > On Thu, Aug 10, 2023 at 8:05 PM Jan Kara wrote: > > > > On Fri 04-08-23 11:01:39, Ryusuke Konishi wrote: > > > On Thu, Aug 3, 2023 at 8:46 PM Jan Kara wrote: > > > > > > > > On Wed 02-08-23

Re: [f2fs-dev] [PATCH 02/12] nilfs2: use setup_bdev_super to de-duplicate the mount code

2023-08-10 Thread Jan Kara
On Fri 04-08-23 11:01:39, Ryusuke Konishi wrote: > On Thu, Aug 3, 2023 at 8:46 PM Jan Kara wrote: > > > > On Wed 02-08-23 17:41:21, Christoph Hellwig wrote: > > > Use the generic setup_bdev_super helper to open the main block device > > > and do various

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

2023-08-09 Thread Jan Kara
ave incremented it. So this hunk is not really changing how inode is marked dirty, it only changes how often we check whether iversion needs increment and that should be fine (and desirable). Hence lazytime isn't really broken by this in any way.

Re: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [PATCH v7 08/13] fs: drop the timespec64 argument from update_time

2023-08-08 Thread Jan Kara
_update_time. > > Signed-off-by: Jeff Layton Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR ___ Linux-f2fs-devel mailing lis

Re: [f2fs-dev] [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

Re: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [PATCH 06/12] fs: use the super_block as holder when mounting file systems

2023-08-03 Thread Jan Kara
On Thu 03-08-23 13:51:31, Jan Kara wrote: > On Wed 02-08-23 17:41:25, Christoph Hellwig wrote: > > The file system type is not a very useful holder as it doesn't allow us > > to go back to the actual file system instance. Pass the super_block instead > > which is us

Re: [f2fs-dev] [PATCH 10/12] ext4: use fs_holder_ops for the log device

2023-08-03 Thread Jan Kara
On Wed 02-08-23 17:41:29, Christoph Hellwig wrote: > Use the generic fs_holder_ops to shut down the file system when the > log device goes away instead of duplicating the logic. > > Signed-off-by: Christoph Hellwig Looks good. Feel free to add: Reviewed-

Re: [f2fs-dev] [PATCH 09/12] ext4: drop s_umount over opening the log device

2023-08-03 Thread Jan Kara
ferable to just drop s_umount over ->fill_super entirely, > but that will require a fairly massive audit first, so we'll do the easy > version here first. > > Signed-off-by: Christoph Hellwig Looks good. Feel free

Re: [f2fs-dev] [PATCH 08/12] fs: export fs_holder_ops

2023-08-03 Thread Jan Kara
On Wed 02-08-23 17:41:27, Christoph Hellwig wrote: > Export fs_holder_ops so that file systems that open additional block > devices can use it as well. > > Signed-off-by: Christoph Hellwig Looks good. Feel free to add: Reviewed-

Re: [f2fs-dev] [PATCH 07/12] fs: stop using get_super in fs_mark_dead

2023-08-03 Thread Jan Kara
ig Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/super.c | 30 ++ > 1 file changed, 26 insertions(+), 4 deletions(-) > > diff --git a/fs/super.c b/fs/super.c > ind

Re: [f2fs-dev] [PATCH 06/12] fs: use the super_block as holder when mounting file systems

2023-08-03 Thread Jan Kara
f-by: Christoph Hellwig Nice, this is what I also wanted to eventually do :). Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/btrfs/super.c | 7 ++- > fs/f2fs/super.c | 7 +++ > fs/super.c | 8 +++

Re: [f2fs-dev] [PATCH 02/12] nilfs2: use setup_bdev_super to de-duplicate the mount code

2023-08-03 Thread Jan Kara
{ > + struct dentry *root_dentry; > + > err = nilfs_attach_snapshot(s, sd.cno, _dentry); > if (err) > goto failed_super; > - } else { > - root_dentry = dget(s->s_root); > + return root_den

Re: [f2fs-dev] [PATCH 05/12] ext4: make the IS_EXT2_SB/IS_EXT3_SB checks more robust

2023-08-03 Thread Jan Kara
sb)->s_bdev->bd_holder == _fs_type) > +#define IS_EXT3_SB(sb) ((sb)->s_type == _fs_type) > > > static inline void __ext4_read_bh(struct buffer_head *bh, blk_opf_t op_flags, > -- > 2.39.2 > -- Jan Kara SUSE Labs, CR ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-31 Thread Jan Kara
On Wed 12-07-23 18:06:35, Haris Iqbal wrote: > On Thu, Jul 6, 2023 at 5:38 PM Christoph Hellwig wrote: > > > > On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > > > Create struct bdev_handle that contains all parameters that need to be > > > p

Re: [f2fs-dev] [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: [f2fs-dev] [PATCH 01/32] block: Provide blkdev_get_handle_* functions

2023-07-06 Thread Jan Kara
On Thu 06-07-23 08:38:40, Christoph Hellwig wrote: > On Tue, Jul 04, 2023 at 02:21:28PM +0200, Jan Kara wrote: > > Create struct bdev_handle that contains all parameters that need to be > > passed to blkdev_put() and provide blkdev_get_handle_* functions that > > return t

Re: [f2fs-dev] [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: [f2fs-dev] [PATCH v2 43/92] f2fs: convert to ctime accessor functions

2023-07-06 Thread Jan Kara
On Wed 05-07-23 15:01:08, Jeff Layton wrote: > In later patches, we're going to change how the inode's ctime field is > used. Switch to using accessor functions instead of raw accesses of > inode->i_ctime. > > Signed-off-by: Jeff Layton Looks good to me. Feel free to add: Rev

Re: [f2fs-dev] [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, > + stru

Re: [f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [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) > > +{ > > +

[f2fs-dev] [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

[f2fs-dev] [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

[f2fs-dev] [PATCH 24/32] f2fs: Convert to blkdev_get_handle_by_dev/path()

2023-07-04 Thread Jan Kara
Convert f2fs to use blkdev_get_handle_by_dev/path() and pass the handle around. CC: Jaegeuk Kim CC: Chao Yu CC: linux-f2fs-devel@lists.sourceforge.net Signed-off-by: Jan Kara --- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 18 +- 2 files changed, 10 insertions(+), 9 deletions

[f2fs-dev] [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: [f2fs-dev] [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: [f2fs-dev] [PATCH v2 4/6] fs: Establish locking order for unrelated directories

2023-06-01 Thread Jan Kara
a network natespace. > If it was inside a chroot (that wasn't on a mount point) there > ware two copies of the 'chroot /' inode and the match failed. > > I might be able to find the test case. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Fa

Re: [f2fs-dev] [PATCH v2 1/6] ext4: Remove ext4 locking of moved directory

2023-06-01 Thread Jan Kara
On Thu 01-06-23 10:52:22, Theodore Ts'o wrote: > On Thu, Jun 01, 2023 at 12:58:21PM +0200, Jan Kara wrote: > > Remove locking of moved directory in ext4_rename2(). We will take care > > of it in VFS instead. This effectively reverts commit 0813299c586b > > ("ext4: Fi

Re: [f2fs-dev] [PATCH v2 4/6] fs: Establish locking order for unrelated directories

2023-06-01 Thread Jan Kara
On Thu 01-06-23 15:58:58, Christian Brauner wrote: > On Thu, Jun 01, 2023 at 12:58:24PM +0200, Jan Kara wrote: > > Currently the locking order of inode locks for directories that are not > > in ancestor relationship is not defined because all operations that > > needed to lock

[f2fs-dev] [PATCH v2 3/6] Revert "f2fs: fix potential corruption when moving a directory"

2023-06-01 Thread Jan Kara
This reverts commit d94772154e524b329a168678836745d2773a6e02. The locking is going to be provided by VFS. CC: Jaegeuk Kim CC: sta...@vger.kernel.org Signed-off-by: Jan Kara --- fs/f2fs/namei.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/fs/f2fs/namei.c

[f2fs-dev] [PATCH v2 0/6] fs: Fix directory corruption when moving directories

2023-06-01 Thread Jan Kara
Hello, this patch set fixes a problem with cross directory renames originally reported in [1]. To quickly sum it up some filesystems (so far we know at least about ext4, udf, f2fs, ocfs2, likely also reiserfs, gfs2 and others) need to lock the directory when it is being renamed into another

[f2fs-dev] [PATCH v2 1/6] ext4: Remove ext4 locking of moved directory

2023-06-01 Thread Jan Kara
Remove locking of moved directory in ext4_rename2(). We will take care of it in VFS instead. This effectively reverts commit 0813299c586b ("ext4: Fix possible corruption when moving a directory") and followup fixes. CC: Ted Tso CC: sta...@vger.kernel.org Signed-off-by: Jan Kara --

[f2fs-dev] [PATCH v2 6/6] fs: Restrict lock_two_nondirectories() to non-directory inodes

2023-06-01 Thread Jan Kara
directory to it. This also allows us to use lock_two_inodes() in lock_two_nondirectories() to concentrate the lock ordering logic in less places. Signed-off-by: Jan Kara --- fs/inode.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 40

[f2fs-dev] [PATCH v2 2/6] Revert "udf: Protect rename against modification of moved directory"

2023-06-01 Thread Jan Kara
This reverts commit f950fd0529130a617b3da526da9fb6a896ce87c2. The locking is going to be provided by vfs_rename() in the following patches. CC: sta...@vger.kernel.org Signed-off-by: Jan Kara --- fs/udf/namei.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git

[f2fs-dev] [PATCH v2 5/6] fs: Lock moved directories

2023-06-01 Thread Jan Kara
filesystems need this locking, we perform it in vfs_rename() because getting the lock ordering right is really difficult and we don't want to expose these locking details to filesystems. CC: sta...@vger.kernel.org Signed-off-by: Jan Kara --- .../filesystems/directory-locking.rst | 26

[f2fs-dev] [PATCH v2 4/6] fs: Establish locking order for unrelated directories

2023-06-01 Thread Jan Kara
ies for RENAME_EXCHANGE operations and for this we need the locking order established even for two tree-unrelated directories. Provide a helper function lock_two_inodes() that establishes lock ordering for any two inodes and use it in lock_two_directories(). CC: sta...@vger.kernel.org Signed-off-by: Jan Kara ---

Re: [f2fs-dev] [PATCH 4/6] fs: Establish locking order for unrelated directories

2023-05-29 Thread Jan Kara
On Fri 26-05-23 11:45:15, Christian Brauner wrote: > On Thu, May 25, 2023 at 12:16:10PM +0200, Jan Kara wrote: > > Currently the locking order of inode locks for directories that are not > > in ancestor relationship is not defined because all operations that > > needed to lock

Re: [f2fs-dev] [PATCH 6/6] fs: Restrict lock_two_nondirectories() to non-directory inodes

2023-05-29 Thread Jan Kara
On Fri 26-05-23 15:13:06, Amir Goldstein wrote: > On Thu, May 25, 2023 at 1:17 PM Jan Kara wrote: > > > > Currently lock_two_nondirectories() is skipping any passed directories. > > After vfs_rename() uses lock_two_inodes(), all the remaining four users > > of this

[f2fs-dev] [PATCH 0/6] fs: Fix directory corruption when moving directories

2023-05-25 Thread Jan Kara
Hello, this patch set fixes a problem with cross directory renames originally reported in [1]. To quickly sum it up some filesystems (so far we know at least about ext4, udf, f2fs, ocfs2, likely also reiserfs, gfs2 and others) need to lock the directory when it is being renamed into another

[f2fs-dev] [PATCH 2/6] Revert "udf: Protect rename against modification of moved directory"

2023-05-25 Thread Jan Kara
This reverts commit f950fd0529130a617b3da526da9fb6a896ce87c2. The locking is going to be provided by vfs_rename() in the following patches. CC: sta...@vger.kernel.org Signed-off-by: Jan Kara --- fs/udf/namei.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git

[f2fs-dev] [PATCH 4/6] fs: Establish locking order for unrelated directories

2023-05-25 Thread Jan Kara
ies for RENAME_EXCHANGE operations and for this we need the locking order established even for two tree-unrelated directories. Provide a helper function lock_two_inodes() that establishes lock ordering for any two inodes and use it in lock_two_directories(). CC: sta...@vger.kernel.org Signed-off-by: Jan Kara ---

[f2fs-dev] [PATCH 6/6] fs: Restrict lock_two_nondirectories() to non-directory inodes

2023-05-25 Thread Jan Kara
directory to it. This also allows us to use lock_two_inodes() in lock_two_nondirectories() to concentrate the lock ordering logic in less places. Signed-off-by: Jan Kara --- fs/inode.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 20

[f2fs-dev] [PATCH 3/6] Revert "f2fs: fix potential corruption when moving a directory"

2023-05-25 Thread Jan Kara
This reverts commit d94772154e524b329a168678836745d2773a6e02. The locking is going to be provided by VFS. CC: Jaegeuk Kim CC: sta...@vger.kernel.org Signed-off-by: Jan Kara --- fs/f2fs/namei.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/fs/f2fs/namei.c

[f2fs-dev] [PATCH 5/6] fs: Lock moved directories

2023-05-25 Thread Jan Kara
filesystems need this locking, we perform it in vfs_rename() because getting the lock ordering right is really difficult and we don't want to expose these locking details to filesystems. CC: sta...@vger.kernel.org Signed-off-by: Jan Kara --- .../filesystems/directory-locking.rst | 26

[f2fs-dev] [PATCH 1/6] ext4: Remove ext4 locking of moved directory

2023-05-25 Thread Jan Kara
Remove locking of moved directory in ext4_rename2(). We will take care of it in VFS instead. This effectively reverts commit 0813299c586b ("ext4: Fix possible corruption when moving a directory") and followup fixes. CC: Ted Tso CC: sta...@vger.kernel.org Signed-off-by: Jan Kara --

Re: [f2fs-dev] [PATCH 3/5] fstests/MAINTAINERS: add supported mailing list

2023-04-05 Thread Jan Kara
; > Signed-off-by: Zorro Lang > --- Looks good to me. Feel free to add: Acked-by: Jan Kara Honza > > If someone mailing list doesn't want to be in cc list of related fstests > patch, please reply this email, I'll

Re: [f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jan Kara
bly we didn't want to use modulo here because EXT4_MMP_SEQ_MAX is rather big and so the resulting 'new_seq' would be seriously non-uniform. Honza -- Jan Kara SUSE Labs, CR ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH 02/11] MM: document and polish read-ahead code.

2022-02-24 Thread Jan Kara
On Fri 11-02-22 10:35:17, NeilBrown wrote: > On Thu, 10 Feb 2022, Jan Kara wrote: > > Hi Neil! > > > > On Thu 10-02-22 16:37:52, NeilBrown wrote: > > > Add some "big-picture" documentation for read-ahead and polish the code > > > to make it

Re: [f2fs-dev] [PATCH 02/11] MM: document and polish read-ahead code.

2022-02-10 Thread Jan Kara
become available. Pages in the final ``async_size`` may be > + * considered less urgent and failure to read them is more acceptable. > + * They will eventually be read individually using ->readpage(). > + */ > + > #include > #include > #include > @@ -426,7 +525,7 @@ static int try_context_readahead(struct address_space > *mapping, > > ra->start = index; > ra->size = min(size + req_size, max); > - ra->async_size = 1; > + ra->async_size = ra->size - req_size; > > return 1; > } > @@ -527,7 +626,7 @@ static void ondemand_readahead(struct readahead_control > *ractl, > initial_readahead: > ra->start = index; > ra->size = get_init_ra_size(req_size, max_pages); > - ra->async_size = ra->size > req_size ? ra->size - req_size : ra->size; > + ra->async_size = ra->size > req_size ? ra->size - req_size : 0; > > readit: > /* > > -- Jan Kara SUSE Labs, CR ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH 10/11] block/bfq-iosched.c: use "false" rather than "BLK_RW_ASYNC"

2022-02-10 Thread Jan Kara
On Thu 10-02-22 16:37:52, NeilBrown wrote: > bfq_get_queue() expects a "bool" for the third arg, so pass "false" > rather than "BLK_RW_ASYNC" which will soon be removed. > > Acked-by: Jens Axboe > Signed-off-by: NeilBrown Looks g

Re: [f2fs-dev] [PATCH 0/14 v10] fs: Hole punch vs page cache filling races

2021-07-16 Thread Jan Kara
On Fri 16-07-21 09:43:11, Darrick J. Wong wrote: > On Fri, Jul 16, 2021 at 07:02:19AM +0100, Christoph Hellwig wrote: > > On Thu, Jul 15, 2021 at 03:40:10PM +0200, Jan Kara wrote: > > > Hello, > > > > > > here is another version of my patches to addres

[f2fs-dev] [PATCH 09/14] xfs: Convert double locking of MMAPLOCK to use VFS helpers

2021-07-15 Thread Jan Kara
Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/xfs/xfs_bmap_util.c | 15 --- fs/xfs/xfs_inode.c | 37 +++-- 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_b

[f2fs-dev] [PATCH 06/14] ext2: Convert to using invalidate_lock

2021-07-15 Thread Jan Kara
Ext2 has its private dax_sem used for synchronizing page faults and truncation. Use mapping->invalidate_lock instead as it is meant for this purpose. CC: Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/ext2/ext2.h | 11 --- fs/ext2/file.c | 7 +++ fs/ext2/inod

[f2fs-dev] [PATCH 05/14] ext4: Convert to use mapping->invalidate_lock

2021-07-15 Thread Jan Kara
ed Tso Acked-by: Theodore Ts'o Reviewed-by: Darrick J. Wong Signed-off-by: Jan Kara --- fs/ext4/ext4.h | 10 -- fs/ext4/extents.c | 25 +--- fs/ext4/file.c | 13 +++-- fs/ext4/inode.c| 47 +- fs/ext4/i

[f2fs-dev] [PATCH 11/14] f2fs: Convert to using invalidate_lock

2021-07-15 Thread Jan Kara
@lists.sourceforge.net Acked-by: Chao Yu Signed-off-by: Jan Kara --- fs/f2fs/data.c | 8 +++ fs/f2fs/f2fs.h | 1 - fs/f2fs/file.c | 62 - fs/f2fs/super.c | 1 - 4 files changed, 34 insertions(+), 38 deletions(-) diff --git a/fs/f2fs/data.c

[f2fs-dev] [PATCH 10/14] zonefs: Convert to using invalidate_lock

2021-07-15 Thread Jan Kara
Use invalidate_lock instead of zonefs' private i_mmap_sem. The intended purpose is exactly the same. CC: Damien Le Moal CC: Johannes Thumshirn CC: Acked-by: Damien Le Moal Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/zonefs/super.c | 23 +-- fs/zonefs

[f2fs-dev] [PATCH 04/14] mm: Add functions to lock invalidate_lock for two mappings

2021-07-15 Thread Jan Kara
Some operations such as reflinking blocks among files will need to lock invalidate_lock for two mappings. Add helper functions to do that. Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- include/linux/fs.h | 6 ++ mm/filemap.c | 38

[f2fs-dev] [PATCH 03/14] mm: Protect operations adding pages to page cache with invalidate_lock

2021-07-15 Thread Jan Kara
r page faults / reads / readahead. Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- Documentation/filesystems/locking.rst | 62 +++-- fs/inode.c| 2 + include/linux/fs.h| 33 + mm/fil

[f2fs-dev] [PATCH 07/14] xfs: Refactor xfs_isilocked()

2021-07-15 Thread Jan Kara
-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Jan Kara --- fs/xfs/xfs_inode.c | 34 ++ fs/xfs/xfs_inode.h | 2 +- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index a835ceb79ba5..359e2cd44ad7

[f2fs-dev] [PATCH 08/14] xfs: Convert to use invalidate_lock

2021-07-15 Thread Jan Kara
: CC: "Darrick J. Wong" Signed-off-by: Jan Kara --- fs/xfs/xfs_file.c | 13 +++- fs/xfs/xfs_inode.c | 50 -- fs/xfs/xfs_inode.h | 1 - fs/xfs/xfs_super.c | 2 -- 4 files changed, 34 insertions(+), 32 deletions(-) diff --gi

[f2fs-dev] [PATCH 0/14 v10] fs: Hole punch vs page cache filling races

2021-07-15 Thread Jan Kara
Hello, here is another version of my patches to address races between hole punching and page cache filling functions for ext4 and other filesystems. The only change since the last time is a small cleanup applied to changes of filemap_fault() in patch 3/14 based on Christoph's & Darrick's feedback

[f2fs-dev] [PATCH 13/14] ceph: Fix race between hole punch and page fault

2021-07-15 Thread Jan Kara
Layton CC: ceph-de...@vger.kernel.org Reviewed-by: Jeff Layton Signed-off-by: Jan Kara --- fs/ceph/addr.c | 9 ++--- fs/ceph/file.c | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index a1e2813731d1..7e7a897ae0d3 100644 --- a/fs/ceph/

[f2fs-dev] [PATCH 12/14] fuse: Convert to using invalidate_lock

2021-07-15 Thread Jan Kara
Signed-off-by: Jan Kara --- fs/fuse/dax.c| 50 +++- fs/fuse/dir.c| 11 ++- fs/fuse/file.c | 10 +- fs/fuse/fuse_i.h | 7 --- fs/fuse/inode.c | 1 - 5 files changed, 35 insertions(+), 44 deletions(-) diff --git a/fs/fuse

  1   2   3   4   >