Re: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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. Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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

Re: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [PATCH v2 47/92] gfs2: convert to ctime accessor functions

2023-07-06 Thread Jan Kara
On Wed 05-07-23 15:01:12, 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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-25 Thread Jan Kara
ulting pages on a file, direct IO to that file can be starved indefinitely. That is IMHO not a good thing and I would not like to use this type of lock in VFS until this problem is resolved. But it should be fixable e.g. by introducing some kind of deadline for a waiter after which it will block acquisitions of the other lock state. Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [PATCH 06/32] sched: Add task_struct->faults_disabled_mapping

2023-05-23 Thread Jan Kara
On Wed 10-05-23 02:18:45, Kent Overstreet wrote: > On Wed, May 10, 2023 at 03:07:37AM +0200, Jan Kara wrote: > > On Tue 09-05-23 12:56:31, Kent Overstreet wrote: > > > From: Kent Overstreet > > > > > > This is used by bcachefs to fix a page cache cohere

Re: [Cluster-devel] [GIT PULL] gfs2 writepage fix

2023-01-23 Thread Jan Kara
states in his changelog of the revert that's a bit more tricky. But at least for ext4 the conversion of data=journal path resulted in much cleaner and shorter code. Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [PATCH v2 13/14] ext2: replace bh_submit_read() helper with bh_read_locked()

2022-09-01 Thread Jan Kara
On Thu 01-09-22 21:35:04, Zhang Yi wrote: > bh_submit_read() and the uptodate check logic in bh_uptodate_or_lock() > has been integrated in bh_read() helper, so switch to use it directly. > > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-

Re: [Cluster-devel] [PATCH v2 10/14] udf: replace ll_rw_block()

2022-09-01 Thread Jan Kara
return NULL; > > - if (buffer_uptodate(bh)) > - return bh; > - > - ll_rw_block(REQ_OP_READ, 1, ); > - > - wait_on_buffer(bh); > - if (buffer_uptodate(bh)) > + if (bh_read(bh, 0) >= 0) > return bh; > > brelse(bh); > -- > 2.31.1 > -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [PATCH v2 11/14] ufs: replace ll_rw_block()

2022-09-01 Thread Jan Kara
o stop using ll_rw_block() in ufs. > > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/ufs/balloc.c | 12 > 1 file changed, 4 insertions(+), 8 deletions(

Re: [Cluster-devel] [PATCH v2 09/14] reiserfs: replace ll_rw_block()

2022-09-01 Thread Jan Kara
been locked by others. So stop using ll_rw_block() in > reiserfs. We also switch to new bh_readahead_batch() helper for the > buffer array readahead path. > > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara

Re: [Cluster-devel] [PATCH v2 08/14] ocfs2: replace ll_rw_block()

2022-09-01 Thread Jan Kara
o stop using ll_rw_block() in ocfs2. > > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/ocfs2/aops.c | 2 +- > fs/ocfs2/super.c | 4 +--- > 2 files changed

Re: [Cluster-devel] [PATCH v2 06/14] jbd2: replace ll_rw_block()

2022-09-01 Thread Jan Kara
o stop using ll_rw_block() in > journal_get_superblock(). We also switch to new bh_readahead_batch() > for the buffer array readahead path. > > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara

Re: [Cluster-devel] [PATCH v2 07/14] ntfs3: replace ll_rw_block()

2022-09-01 Thread Jan Kara
o stop using ll_rw_block() in > ntfs_get_block_vbo(). > > Signed-off-by: Zhang Yi Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/ntfs3/inode.c | 7 ++- > 1 file changed, 2 insertions(+),

Re: [Cluster-devel] [PATCH v2 04/14] gfs2: replace ll_rw_block()

2022-09-01 Thread Jan Kara
; > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/gfs2/meta_io.c | 7 ++- > fs/gfs2/quota.c | 8 ++-- > 2 files changed, 4 insertions(+), 11 deletion

Re: [Cluster-devel] [PATCH v2 03/14] fs/buffer: replace ll_rw_block()

2022-09-01 Thread Jan Kara
antee buffer locked and submit IO if needed. > > Signed-off-by: Zhang Yi Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/buffer.c | 12 +--- > 1 file changed, 5 insertions(+), 7 deleti

Re: [Cluster-devel] [PATCH v2 02/14] fs/buffer: add some new buffer read helpers

2022-09-01 Thread Jan Kara
; Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/buffer.c | 65 + > include/linux/buffer_head.h | 38

Re: [Cluster-devel] [PATCH 02/14] fs/buffer: add some new buffer read helpers

2022-08-31 Thread Jan Kara
h_read()). > + > +static inline void bh_read_batch(struct buffer_head *bhs[], int nr) > +{ > + __bh_read_batch(bhs, nr, 0, true); > +} > + > +static inline void bh_readahead_batch(struct buffer_head *bhs[], int nr, > + blk_opf_t op_flags) > +{ > + __bh_read_batch(bhs, nr, op_flags, false); > +} > + It is more common to have number of elements in the array as the first argument and the array as the second one in the kernel. So rather: static inline void bh_read_batch(int nr, struct buffer_head *bhs[]) and similarly for bh_readahead_batch(). Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [PATCH 08/14] ocfs2: replace ll_rw_block()

2022-08-31 Thread Jan Kara
nlock_buffer(*bh); > - ll_rw_block(REQ_OP_READ, 1, bh); > - wait_on_buffer(*bh); > - if (!buffer_uptodate(*bh)) { > + if (bh_read_locked(*bh, 0)) { > mlog_errno(-EIO); > brelse(*bh); > *bh = NULL; I would just use bh_read() here and drop bh_read_locked() altogether... Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [PATCH 14/14] fs/buffer: remove bh_submit_read() helper

2022-08-31 Thread Jan Kara
On Wed 31-08-22 15:21:11, Zhang Yi wrote: > bh_submit_read() has no user anymore, just remove it. > > Signed-off-by: Zhang Yi Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/buffer.c

Re: [Cluster-devel] [PATCH 13/14] ext2: replace bh_submit_read() helper with bh_read_locked()

2022-08-31 Thread Jan Kara
brelse(bh); > ext2_error(sb, __func__, > "Cannot read block bitmap - " > -- > 2.31.1 > -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [PATCH 12/14] fs/buffer: remove ll_rw_block() helper

2022-08-31 Thread Jan Kara
On Wed 31-08-22 15:21:09, Zhang Yi wrote: > Now that all ll_rw_block() users has been replaced to new safe helpers, > we just remove it here. > > Signed-off-by: Zhang Yi Looks good. Feel free to add: Reviewed-by: Jan Kara

Re: [Cluster-devel] [PATCH 11/14] ufs: replace ll_rw_block()

2022-08-31 Thread Jan Kara
o stop using ll_rw_block() in ufs. > > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/ufs/balloc.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > &g

Re: [Cluster-devel] [PATCH 10/14] udf: replace ll_rw_block()

2022-08-31 Thread Jan Kara
o stop using ll_rw_block(). We also switch to > new bh_readahead_batch() helper for the buffer array readahead path. > > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- &

Re: [Cluster-devel] [PATCH 09/14] reiserfs: replace ll_rw_block()

2022-08-31 Thread Jan Kara
been locked by others. So stop using ll_rw_block() in > reiserfs. We also switch to new bh_readahead_batch() helper for the > buffer array readahead path. > > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara

Re: [Cluster-devel] [PATCH 07/14] ntfs3: replace ll_rw_block()

2022-08-31 Thread Jan Kara
o stop using ll_rw_block() in > ntfs_get_block_vbo(). > > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/ntfs3/inode.c | 7 ++- > 1 file changed, 2 insertion

Re: [Cluster-devel] [PATCH 06/14] jbd2: replace ll_rw_block()

2022-08-31 Thread Jan Kara
o stop using ll_rw_block() in > journal_get_superblock(). We also switch to new bh_readahead_batch() > for the buffer array readahead path. > > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara

Re: [Cluster-devel] [PATCH 05/14] isofs: replace ll_rw_block()

2022-08-31 Thread Jan Kara
y others. So stop using ll_rw_block(), > switch to sync helper instead. > > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/isofs/compress.c | 2 +- > 1 file chang

Re: [Cluster-devel] [PATCH 04/14] gfs2: replace ll_rw_block()

2022-08-31 Thread Jan Kara
; > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/gfs2/meta_io.c | 6 ++ > fs/gfs2/quota.c | 4 +--- > 2 files changed, 3 insertions(+), 7 deletions(-) > >

Re: [Cluster-devel] [PATCH 03/14] fs/buffer: replace ll_rw_block()

2022-08-31 Thread Jan Kara
AD | REQ_RAHEAD, 1, ); > + if (trylock_buffer(bh)) > + __bh_read(bh, REQ_RAHEAD, false); I suppose this can be bh_readahead()? > brelse(bh); > } > } Otherwise the patch looks good. Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [PATCH 01/14] fs/buffer: remove __breadahead_gfp()

2022-08-31 Thread Jan Kara
On Wed 31-08-22 15:20:58, Zhang Yi wrote: > No one use __breadahead_gfp() and sb_breadahead_unmovable() any more, > remove them. > > Signed-off-by: Zhang Yi Looks good. Feel free to add: Reviewed-by: Jan Kara Honza

Re: [Cluster-devel] remove iomap_writepage v2

2022-07-28 Thread Jan Kara
> > Diffstat: > fs/gfs2/aops.c | 26 -- > fs/gfs2/log.c |5 ++--- > fs/iomap/buffered-io.c | 15 --- > fs/zonefs/super.c |8 > include/linux/iomap.h |3 --- > 5 files changed, 2 insertions(+), 55 deletions(-) -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [GFS2 PATCH 10/10] gfs2: replace sd_aspace with sd_inode

2021-07-28 Thread Jan Kara
look it up via the hashes? > > > > > > Steve. > > > > > > Hi, > > > > > > The actual use case, which is easily demonstrated with lockdep, is > > > given > > > in the patch text shortly after where you placed your commen

Re: [Cluster-devel] [PATCH v3 5/7] iomap: Support restarting direct I/O requests after user copy failures

2021-07-26 Thread Jan Kara
On Mon 26-07-21 19:45:22, Andreas Grünbacher wrote: > Jan Kara schrieb am Mo., 26. Juli 2021, 19:21: > > > On Fri 23-07-21 22:58:38, Andreas Gruenbacher wrote: > > > In __iomap_dio_rw, when iomap_apply returns an -EFAULT error, complete > > the > > > request

Re: [Cluster-devel] [PATCH v3 7/7] gfs2: Fix mmap + page fault deadlocks for direct I/O

2021-07-26 Thread Jan Kara
On Mon 26-07-21 19:50:23, Andreas Grünbacher wrote: > Jan Kara schrieb am Mo., 26. Juli 2021, 19:10: > > > On Fri 23-07-21 22:58:40, Andreas Gruenbacher wrote: > > > Also disable page faults during direct I/O requests and implement the > > same kind > > > o

Re: [Cluster-devel] [PATCH v3 5/7] iomap: Support restarting direct I/O requests after user copy failures

2021-07-26 Thread Jan Kara
magic error code to fall back to buffered I/O */ > if (ret == -ENOTBLK) { > wait_for_completion = true; > -- > 2.26.3 > -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [PATCH v3 7/7] gfs2: Fix mmap + page fault deadlocks for direct I/O

2021-07-26 Thread Jan Kara
if (ret) > goto out_uninit; > > + pagefault_disable(); Is there any use in pagefault_disable() here? iomap_dio_rw() should not trigger any page faults anyway, should it? Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [PATCH v3 1/7] iov_iter: Introduce fault_in_iov_iter helper

2021-07-26 Thread Jan Kara
; + break; > + nend = nstart + ret * PAGE_SIZE; > + } > + if (locked) > + mmap_read_unlock(mm); > + if (nstart > start) > + return min(nstart - start, len); > + return 0; > +} > + > /** > * get_dump_page() - pin user page in memory while writing it to core dump > * @addr: user address > -- > 2.26.3 > -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [PATCH 6/6] gfs2: Fix mmap + page fault deadlocks (part 2)

2021-05-24 Thread Jan Kara
On Fri 21-05-21 17:46:04, Andreas Gruenbacher wrote: > On Fri, May 21, 2021 at 5:23 PM Jan Kara wrote: > > On Thu 20-05-21 16:07:56, Andreas Gruenbacher wrote: > > > > So you probably need to add a new VM_FAULT_ > > > > return code that will b

Re: [Cluster-devel] [PATCH 6/6] gfs2: Fix mmap + page fault deadlocks (part 2)

2021-05-21 Thread Jan Kara
On Thu 20-05-21 16:07:56, Andreas Gruenbacher wrote: > On Thu, May 20, 2021 at 3:30 PM Jan Kara wrote: > > On Thu 20-05-21 14:25:36, Andreas Gruenbacher wrote: > > > Now that we handle self-recursion on the inode glock in gfs2_fault and > > > gfs2_page_mkwrite, w

Re: [Cluster-devel] [PATCH 6/6] gfs2: Fix mmap + page fault deadlocks (part 2)

2021-05-20 Thread Jan Kara
On Thu 20-05-21 14:25:36, Andreas Gruenbacher wrote: > Now that we handle self-recursion on the inode glock in gfs2_fault and > gfs2_page_mkwrite, we need to take care of more complex deadlock > scenarios like the following (example by Jan Kara): > > Two independent processes P1, P

Re: [Cluster-devel] [PATCH 1/3] fs/buffer.c: add new api to allow eof writeback

2021-05-05 Thread Jan Kara
On Tue 04-05-21 16:35:53, Junxiao Bi wrote: > On 5/4/21 2:02 AM, Jan Kara wrote: > > On Mon 03-05-21 10:25:31, Junxiao Bi wrote: > > > On 5/3/21 3:29 AM, Jan Kara wrote: > > > > On Fri 30-04-21 14:18:15, Junxiao Bi wrote: > > > > > On 4/30/21 5:47 AM,

Re: [Cluster-devel] [PATCH 1/3] fs/buffer.c: add new api to allow eof writeback

2021-05-04 Thread Jan Kara
On Mon 03-05-21 10:25:31, Junxiao Bi wrote: > > On 5/3/21 3:29 AM, Jan Kara wrote: > > On Fri 30-04-21 14:18:15, Junxiao Bi wrote: > > > On 4/30/21 5:47 AM, Jan Kara wrote: > > > > > > > On Thu 29-04-21 11:07:15, Junxiao Bi wrote: > > >

Re: [Cluster-devel] [PATCH 1/3] fs/buffer.c: add new api to allow eof writeback

2021-05-03 Thread Jan Kara
On Fri 30-04-21 14:18:15, Junxiao Bi wrote: > On 4/30/21 5:47 AM, Jan Kara wrote: > > > On Thu 29-04-21 11:07:15, Junxiao Bi wrote: > > > On 4/29/21 10:14 AM, Andreas Gruenbacher wrote: > > > > On Tue, Apr 27, 2021 at 4:44 AM Junxiao Bi > > > > w

Re: [Cluster-devel] [PATCH 1/3] fs/buffer.c: add new api to allow eof writeback

2021-04-30 Thread Jan Kara
er? It will be more efficient than going through the page cache and you also won't have to tweak block_write_full_page()... Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] Hole punch races in GFS2

2021-04-22 Thread Jan Kara
ing > > > > And even if the locking isn't recursive, you have glock->mmap_sem and > > mmap_sem->glock lock orderings so ABBA deadlocks are possible AFAICT. > > > > And there's a similar problem with the write path as well, just the lock is > > grabbed exclusively. &

Re: [Cluster-devel] Hole punch races in GFS2

2021-04-22 Thread Jan Kara
On Thu 22-04-21 14:51:42, Andreas Gruenbacher wrote: > Hi Jan, > > On Thu, Apr 22, 2021 at 1:26 PM Jan Kara wrote: > > I am looking into how GFS2 protects against races between hole punching and > > things like page fault or readahead and AFAICT it seems it does n

[Cluster-devel] Hole punch races in GFS2

2021-04-22 Thread Jan Kara
). If gfs2_page_mkwrite() sneaked in that window as well, we might be even racing with writeback and are possibly corrupting the filesystem on disk. Is there anything I'm missing? Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] RFC: hold i_rwsem until aio completes

2020-01-16 Thread Jan Kara
may be especially painful for filesystems that don't implement DIO overwrites with i_rwsem in shared mode... Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [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: [Cluster-devel] [Q] gfs2: mmap write vs. punch_hole consistency

2019-09-09 Thread Jan Kara
o writeprotect pages, GFS2 still seems to have a race where page fault can come while you are freeing blocks and if you allow that you usually get into a problematic state. Effects depend on fs implementation details but usually it can result in stale data exposure or fs corruption. Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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: [Cluster-devel] [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

Re: [PATCH 5/5] vfs: only allow FSSETXATTR to set DAX flag on files and dirs

2019-06-29 Thread Jan Kara
On Fri 28-06-19 11:34:31, Darrick J. Wong wrote: > From: Darrick J. Wong > > The DAX flag only applies to files and directories, so don't let it get > set for other types of files. > > Signed-off-by: Darrick J. Wong Looks good to me. You can add: Rev

Re: [PATCH 4/4] vfs: teach vfs_ioc_fssetxattr_check to check extent size hints

2019-06-20 Thread Jan Kara
On Mon 10-06-19 21:46:05, Darrick J. Wong wrote: > From: Darrick J. Wong > > Move the extent size hint checks that aren't xfs-specific to the vfs. > > Signed-off-by: Darrick J. Wong The patch looks good to me. You can add: Review

Re: [PATCH 3/4] fs: teach vfs_ioc_fssetxattr_check to check project id info

2019-06-20 Thread Jan Kara
On Mon 10-06-19 21:45:57, Darrick J. Wong wrote: > From: Darrick J. Wong > > Standardize the project id checks for FSSETXATTR. > > Signed-off-by: Darrick J. Wong The patch looks good to me. You can add: Review

Re: [PATCH 2/4] vfs: create a generic checking function for FS_IOC_FSSETXATTR

2019-06-20 Thread Jan Kara
atch looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > fs/btrfs/ioctl.c | 21 +--- > fs/ext4/ioctl.c| 27 ++-- > fs/f2fs/file.c | 26 ++-

Re: [PATCH v2 1/4] vfs: create a generic checking function for FS_IOC_SETFLAGS

2019-06-20 Thread Jan Kara
ong The patch looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > v2: fix jfs locking and remove its opencoded flags check > --- > fs/btrfs/ioctl.c| 13 + > fs/efivarfs/file.c

Re: [Cluster-devel] [PATCH] fs: Move mark_inode_dirty out of __generic_write_end

2019-06-19 Thread Jan Kara
> while (len > 0) { > ret = iomap_apply(inode, pos, len, IOMAP_ZERO, > ops, did_zero, iomap_zero_range_actor); > if (ret <= 0) > - return ret; > + goto out; > > pos += ret; > len -= ret; > } > + ret = 0; > > - return 0; > +out: > + if (old_size != inode->i_size) > + mark_inode_dirty(inode); > + > + return ret; > } > EXPORT_SYMBOL_GPL(iomap_zero_range); > > -- > 2.20.1 > -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [PATCH v6 1/4] iomap: Clean up __generic_write_end calling

2019-04-29 Thread Jan Kara
> > Signed-off-by: Christoph Hellwig > Signed-off-by: Andreas Gruenbacher Looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > fs/iomap.c | 18 -- > 1 file changed, 8 insertions(+)

Re: [Cluster-devel] [PATCH v6 3/4] iomap: Add a page_prepare callback

2019-04-29 Thread Jan Kara
in page_done. Other filesystems that implement data journaling will > require the same kind of mechanism. > > Signed-off-by: Andreas Gruenbacher Looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- >

Re: [Cluster-devel] [PATCH v5 1/3] iomap: Fix use-after-free error in page_done callback

2019-04-29 Thread Jan Kara
neric_write_end into the > callers of __generic_write_end. Then, in iomap_write_end, put the page > after calling the page_done callback. > > Reported-by: Jan Kara > Fixes: 63899c6f8851 ("iomap: add a page_done callback") > Signed-off-by: Andreas Gruenbacher The patch looks good

Re: [Cluster-devel] [PATCH v3 1/2] iomap: Add a page_prepare callback

2019-04-26 Thread Jan Kara
); Looking at the code now, this is actually flawed (preexisting problem): __iomap_write_end or generic_write_end() will release the page reference and so you cannot just pass it to ->page_done(). That is a potential use-after-free... Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] [PATCH 1/2] iomap: Add a page_prepare callback

2019-04-25 Thread Jan Kara
o won't it be more natural to just mandate ->page_prepare() and ->page_done() callbacks and each filesystem would set it to a helper function it needs? Probably we could get rid of IOMAP_F_BUFFER_HEAD flag that way... Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] gfs2 iomap dealock, IOMAP_F_UNBALANCED

2019-04-08 Thread Jan Kara
d to clean dirty pages. iomap doesn't > allow us to put the block allocation into a separate transaction from > the page writes; for that, the opposite to the page_done hook would > probably be needed. I agree that a ->page_prepare() hook would be probably the cleanest solution for this. Honza -- Jan Kara SUSE Labs, CR

Re: [Cluster-devel] WARNING in account_page_dirtied

2018-04-05 Thread Jan Kara
Hi, On Wed 04-04-18 13:56:53, Steven Whitehouse wrote: > On 04/04/18 13:36, Jan Kara wrote: > > Hi, > > > > On Wed 04-04-18 10:24:48, Steven Whitehouse wrote: > > > On 03/04/18 13:05, Jan Kara wrote: > > > > Hello, > > > > > > >

Re: [Cluster-devel] WARNING in account_page_dirtied

2018-04-04 Thread Jan Kara
Hi, On Wed 04-04-18 10:24:48, Steven Whitehouse wrote: > On 03/04/18 13:05, Jan Kara wrote: > > Hello, > > > > On Sun 01-04-18 10:01:02, syzbot wrote: > > > syzbot hit the following crash on upstream commit > > > 10b84daddbec72c6b440216a69de9a960

Re: [Cluster-devel] WARNING in account_page_dirtied

2018-04-03 Thread Jan Kara
2 ORIG_RAX: 00e7 > RAX: ffda RBX: RCX: 00456c29 > RDX: 004170e0 RSI: RDI: 0001 > RBP: 0003 R08: 000a R09: 00418100 > R10: 0000200a9300 R11: 0202 R12: 0004 > R13: 00418100 R14: R15: > Dumping ftrace buffer: >(ftrace buffer empty) > Kernel Offset: disabled > Rebooting in 86400 seconds.. Honza -- Jan Kara <j...@suse.com> SUSE Labs, CR

Re: [Cluster-devel] [PATCH 4/4] fs: move I_DIRTY_INODE to fs.h

2018-02-26 Thread Jan Kara
On Wed 21-02-18 07:54:49, Christoph Hellwig wrote: > And use it in a few more places rather than opencoding the values. > > Signed-off-by: Christoph Hellwig <h...@lst.de> Looks fine to me. You can add: Reviewed-by: Jan Kar

[Cluster-devel] [PATCH 08/16] gfs2: Use pagevec_lookup_range_tag()

2017-10-09 Thread Jan Kara
; Signed-off-by: Jan Kara <j...@suse.cz> --- fs/gfs2/aops.c | 20 ++-- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 68ed06962537..d0848d9623fb 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -280,22 +2

[Cluster-devel] [PATCH 08/15] gfs2: Use pagevec_lookup_range_tag()

2017-09-27 Thread Jan Kara
We want only pages from given range in gfs2_write_cache_jdata(). Use pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove unnecessary code. CC: Bob Peterson <rpete...@redhat.com> CC: cluster-devel@redhat.com Signed-off-by: Jan Kara <j...@suse.cz> --- fs/gfs2

[Cluster-devel] [PATCH 08/15] gfs2: Use pagevec_lookup_range_tag()

2017-09-14 Thread Jan Kara
We want only pages from given range in gfs2_write_cache_jdata(). Use pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove unnecessary code. CC: Bob Peterson <rpete...@redhat.com> CC: cluster-devel@redhat.com Signed-off-by: Jan Kara <j...@suse.cz> --- fs/gfs2

Re: [Cluster-devel] [PATCH v3] mm: add file_fdatawait_range and file_write_and_wait

2017-08-01 Thread Jan Kara
On Mon 31-07-17 12:49:25, Jeff Layton wrote: > From: Jeff Layton <jlay...@redhat.com> > > Necessary now for gfs2_fsync and sync_file_range, but there will > eventually be other callers. > > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks good to me. You can

Re: [Cluster-devel] [PATCH v2 2/4] mm: add file_fdatawait_range and file_write_and_wait

2017-07-31 Thread Jan Kara
On Mon 31-07-17 09:00:37, Jeff Layton wrote: > On Mon, 2017-07-31 at 14:07 +0200, Jan Kara wrote: > > On Mon 31-07-17 07:44:16, Jeff Layton wrote: > > > On Mon, 2017-07-31 at 12:32 +0100, Steven Whitehouse wrote: > > > > On 31/07/17 12:27, Jeff Layton wrote: > &g

Re: [Cluster-devel] [PATCH v2 2/4] mm: add file_fdatawait_range and file_write_and_wait

2017-07-31 Thread Jan Kara
On Mon 31-07-17 07:44:16, Jeff Layton wrote: > On Mon, 2017-07-31 at 12:32 +0100, Steven Whitehouse wrote: > > On 31/07/17 12:27, Jeff Layton wrote: > > > On Thu, 2017-07-27 at 08:48 -0400, Jeff Layton wrote: > > > > On Thu, 2017-07-27 at 10:49 +0200, Jan Kara wrote

Re: [Cluster-devel] [PATCH v2 1/4] mm: consolidate dax / non-dax checks for writeback

2017-07-27 Thread Jan Kara
On Wed 26-07-17 13:55:35, Jeff Layton wrote: > From: Jeff Layton <jlay...@redhat.com> > > We have this complex conditional copied to several places. Turn it into > a helper function. > > Signed-off-by: Jeff Layton <jlay...@redhat.com> Looks good. You can

  1   2   3   4   5   >