Re: [PATCH 00/10] convert the majority of file systems to mmap_prepare

2025-06-17 Thread Jeff Layton
; > Documentation/filesystems/porting.rst? Also, an entry for ->mmap_prepare in Documentation/filesystems/vfs.rst would be good. I went there first to understand what the requirements of mmap_prepare are, but there is nothing. -- Jeff Layton

Re: [RFC] mm: alloc_pages_bulk: remove assumption of populating only NULL elements

2025-02-17 Thread Jeff Layton via Linux-erofs
= RPCSVC_MAXPAGES; > } > > - for (filled = 0; filled < pages; filled = ret) { > - ret = alloc_pages_bulk(GFP_KERNEL, pages, rqstp->rq_pages); > - if (ret > filled) > + for (filled = 0; filled < pages; filled += ret) { > + ret = alloc_pages_bulk(GFP_KERNEL, pages - filled, > +rqstp->rq_pages + filled); > + if (ret) > /* Made progress, don't sleep yet */ > continue; > > @@ -674,7 +675,7 @@ static bool svc_alloc_arg(struct svc_rqst *rqstp) > set_current_state(TASK_RUNNING); > return false; > } > - trace_svc_alloc_arg_err(pages, ret); > + trace_svc_alloc_arg_err(pages, filled); > memalloc_retry_wait(GFP_KERNEL); > } > rqstp->rq_page_end = &rqstp->rq_pages[pages]; I agree that the API is cumbersome and weird as it is today. For the sunrpc parts: Acked-by: Jeff Layton

Re: lockref cleanups

2025-01-22 Thread Jeff Layton via Linux-erofs
rom the commit log problem Andreas pointed out in patch #2, this looks good. Assuming that's fixed: Reviewed-by: Jeff Layton

Re: [PATCH v2 0/5] cachefiles: some bugfixes for clean object/send req/poll

2024-06-27 Thread Jeff Layton
files: add missing lock protection when polling > >  fs/cachefiles/daemon.c   |  4 ++-- >  fs/cachefiles/internal.h |  3 +++ >  fs/cachefiles/ondemand.c | 52 +++++++- >  3 files changed, 51 insertions(+), 8 deletions(-) > The set itself looks fairly straightforward, but I don't know this code well enough to give it a proper review. Acked-by: Jeff Layton

Re: [PATCH v2 2/5] cachefiles: flush all requests for the object that is being dropped

2024-06-27 Thread Jeff Layton
req->error = -EIO; > + complete(&req->done); > + __xa_erase(&cache->reqs, index); > + } > + } > + xa_unlock(&cache->reqs); >  } >   >  int cachefiles_ondemand_init_obj_info(struct cachefiles_object > *object, -- Jeff Layton

Re: [PATCH v2 4/5] cachefiles: cyclic allocation of msg_id to avoid reuse

2024-05-20 Thread Jeff Layton
On Mon, 2024-05-20 at 20:42 +0800, Baokun Li wrote: > On 2024/5/20 18:04, Jeff Layton wrote: > > On Mon, 2024-05-20 at 12:06 +0800, Baokun Li wrote: > > > Hi Jeff, > > > > > > Thank you very much for your review! > > > > > > On 2024/5/19 19:1

Re: [PATCH v2 4/5] cachefiles: cyclic allocation of msg_id to avoid reuse

2024-05-20 Thread Jeff Layton
On Mon, 2024-05-20 at 12:06 +0800, Baokun Li wrote: > Hi Jeff, > > Thank you very much for your review! > > On 2024/5/19 19:11, Jeff Layton wrote: > > On Wed, 2024-05-15 at 20:51 +0800, libao...@huaweicloud.com wrote: > > > From: Baokun Li > > > >

Re: [PATCH v2 4/5] cachefiles: cyclic allocation of msg_id to avoid reuse

2024-05-19 Thread Jeff Layton
xas_clear_mark(&xas, XA_FREE_MARK); > - xas_set_mark(&xas, CACHEFILES_REQ_NEW); > + if (xas_valid(&xas)) { > + cache->msg_id_next = xas.xa_index + 1; If you have a long-standing stuck request, could this counter wrap around and you still end up with reuse? Maybe this should be using ida_alloc/free instead, which would prevent that too? > + xas_clear_mark(&xas, XA_FREE_MARK); > + xas_set_mark(&xas, CACHEFILES_REQ_NEW); > + } > xas_unlock(&xas); > } while (xas_nomem(&xas, GFP_KERNEL)); > -- Jeff Layton

Re: [PATCH v2 00/12] cachefiles: some bugfixes and cleanups for ondemand requests

2024-05-19 Thread Jeff Layton
| 3 +- > fs/cachefiles/internal.h | 5 + > fs/cachefiles/ondemand.c | 218 ++ > include/trace/events/cachefiles.h | 8 +- > 4 files changed, 177 insertions(+), 57 deletions(-) > Looks like most of these are fixes inside the ondemand code, which I don't have the greatest grasp of, so... Acked-by: Jeff Layton

Re: [PATCH 00/26] netfs, afs, 9p, cifs: Rework netfs to use ->writepages() to copy to cache

2024-04-15 Thread Jeff Layton
/9p/client.c | 49 +++ > net/9p/trans_fd.c| 1 - > 40 files changed, 2492 insertions(+), 1906 deletions(-) > delete mode 100644 fs/netfs/output.c > create mode 100644 fs/netfs/write_collect.c > create mode 100644 fs/netfs/write_issue.c > This all looks pretty reasonable. There is at least one bugfix that looks like it ought to go in independently (#17). #19 is huge, complex and hard to review. That will need some cycles in -next, I think. In any case, on any that I didn't send comments you can add: Reviewed-by: Jeff Layton

Re: [PATCH 17/26] netfs: Fix writethrough-mode error handling

2024-04-15 Thread Jeff Layton
On Thu, 2024-03-28 at 16:34 +, David Howells wrote: > Fix the error return in netfs_perform_write() acting in writethrough-mode > to return any cached error in the case that netfs_end_writethrough() > returns 0. > > Signed-off-by: David Howells > cc: Jeff Layton > cc:

Re: [PATCH 24/26] netfs: Remove the old writeback code

2024-04-15 Thread Jeff Layton
On Thu, 2024-03-28 at 16:34 +, David Howells wrote: > Remove the old writeback code. > > Signed-off-by: David Howells > cc: Jeff Layton > cc: Eric Van Hensbergen > cc: Latchesar Ionkov > cc: Dominique Martinet > cc: Christian Schoenebeck > cc: Marc Dionne

Re: [PATCH 11/26] 9p: Use alternative invalidation to using launder_folio

2024-04-15 Thread Jeff Layton
ric Van Hensbergen > cc: Latchesar Ionkov > cc: Dominique Martinet > cc: Christian Schoenebeck > cc: Jeff Layton > cc: v...@lists.linux.dev > cc: ne...@lists.linux.dev > cc: linux-fsde...@vger.kernel.org > --- > fs/9p/vfs_addr.c | 2 -- > 1 file changed, 2 deletions(-)

Re: [PATCH 09/26] mm: Provide a means of invalidation without using launder_folio

2024-04-15 Thread Jeff Layton
d faulting > through mmap all from adding pages for the duration. > > Signed-off-by: David Howells > cc: Matthew Wilcox > cc: Miklos Szeredi > cc: Trond Myklebust > cc: Christoph Hellwig > cc: Andrew Morton > cc: Alexander Viro > cc: Christian Brauner > cc: Jeff

Re: [PATCH 03/26] netfs: Update i_blocks when write committed to pagecache

2024-04-15 Thread Jeff Layton
get back new attrs from the server, but is that a problem? I'm mainly curious as to what's paying attention to the i_blocks during this window. > Signed-off-by: David Howells > cc: Steve French > cc: Shyam Prasad N > cc: Rohith Surabattula > cc: Jeff Layton > cc

Re: [PATCH 01/26] cifs: Fix duplicate fscache cookie warnings

2024-04-15 Thread Jeff Layton
cc: Steve French > cc: Shyam Prasad N > cc: Rohith Surabattula > cc: Jeff Layton > cc: linux-c...@vger.kernel.org > cc: ne...@lists.linux.dev > cc: linux-fsde...@vger.kernel.org > --- > fs/smb/client/fscache.c | 16 +++- > fs/smb/client/inode.c | 2 ++ &

Re: [PATCH RESEND] cachefiles: fix memory leak in cachefiles_add_cache()

2024-02-18 Thread Jeff Layton
les_put_directory(cache->store); > mntput(cache->mnt); > + put_cred(cache->cache_cred); > > kfree(cache->rootdirname); > kfree(cache->secctx); Looks reasonable to me too. Nice catch: Reviewed-by: Jeff Layton

Re: [PATCH 2/2] netfs: Fix missing zero-length check in unbuffered write

2024-01-29 Thread Jeff Layton
153a9961b551 ("netfs: Implement unbuffered/DIO write support") > Reported-by: Eric Van Hensbergen > Link: https://lore.kernel.org/r/ZbQUU6QKmIftKsmo@FV7GG9FTHL/ > Signed-off-by: David Howells > cc: Dominique Martinet > cc: Jeff Layton > cc: v...@lists.linux.d

Re: [PATCH 1/2] netfs: Fix i_dio_count leak on DIO read past i_size

2024-01-29 Thread Jeff Layton
op > of the function. > > This can cause subsequent buffered read requests to block > indefinitely, waiting for a non existing dio operation to complete. > > Add a inode_dio_end() for the NETFS_DIO_READ case, before returning. > > Signed-off-by: Marc Dionne > Signed-off-by

Re: [PATCH 00/10] netfs, afs, cifs, cachefiles, erofs: Miscellaneous fixes

2024-01-22 Thread Jeff Layton
| 2 +- > fs/netfs/misc.c| 2 +- > fs/smb/client/file.c | 10 +- > include/trace/events/afs.h | 25 + > 11 files changed, 83 insertions(+), 46 deletions(-) > These all look fine to me. You can add this to the set: Reviewed-by: Jeff Layton

Re: [PATCH 01/10] netfs: Don't use certain internal folio_*() functions

2024-01-22 Thread Jeff Layton
s automagically with: > > perl -p -i -e 's/folio_mapping[(]([^)]*)[)]/\1->mapping/g' fs/netfs/*.c > perl -p -i -e 's/folio_file_mapping[(]([^)]*)[)]/\1->mapping/g' fs/netfs/*.c > perl -p -i -e 's/folio_index[(]([^)]*)[)]/\1->index/g' fs/netfs/*.c &

Re: [PATCH 0/4] netfs, afs, erofs, cifs: Don't use certain internal folio_*() functions

2024-01-09 Thread Jeff Layton
+- > 7 files changed, 26 insertions(+), 26 deletions(-) > Looks like a fairly straightforward cleanup. Aside from the changelog comments on patch #1: Reviewed-by: Jeff Layton

Re: [PATCH 1/4] netfs: Don't use certain internal folio_*() functions

2024-01-09 Thread Jeff Layton
; folio_index(folio) <= unlocked) > + if (have_unlocked && folio->index <= unlocked) > continue; > unlocked = folio_next_index(folio) - 1; > trace_netfs_folio(folio, netfs_folio_trace_end_copy); > diff --git a/fs/netfs/misc.c b/fs/netfs/misc.c > index 0e3af37fc924..90051ced8e2a 100644 > --- a/fs/netfs/misc.c > +++ b/fs/netfs/misc.c > @@ -180,7 +180,7 @@ void netfs_invalidate_folio(struct folio *folio, size_t > offset, size_t length) > struct netfs_folio *finfo = NULL; > size_t flen = folio_size(folio); > > - _enter("{%lx},%zx,%zx", folio_index(folio), offset, length); > + _enter("{%lx},%zx,%zx", folio->index, offset, length); > > folio_wait_fscache(folio); > > Patch seems fine otherwise: Reviewed-by: Jeff Layton

Re: [PATCH 0/6] netfs, cachefiles: More additional patches

2024-01-09 Thread Jeff Layton
- > include/linux/fscache-cache.h | 3 +++ > include/linux/netfs.h | 1 + > 9 files changed, 56 insertions(+), 30 deletions(-) > These all look fine to me. You can add: Reviewed-by: Jeff Layton

[PATCH v2 89/89] fs: move i_generation into new hole created after timestamp conversion

2023-10-06 Thread Jeff Layton
i_fsnotify_mask in my setup. Suggested-by: Amir Goldstein Signed-off-by: Jeff Layton --- include/linux/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 485b5e21c8e5..686c9f33e725 100644 --- a/include/linux/fs.h +++ b/include/linux

[PATCH v2 87/89] fs: rename inode i_atime and i_mtime fields

2023-10-06 Thread Jeff Layton
Rename these two fields to discourage direct access (and to help ensure that we mop up any leftover direct accesses). Signed-off-by: Jeff Layton --- include/linux/fs.h | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/linux/fs.h b/include/linux

[PATCH v2 88/89] fs: switch timespec64 fields in inode to discrete integers

2023-10-06 Thread Jeff Layton
This shaves 8 bytes off struct inode with a garden-variety Fedora Kconfig. Signed-off-by: Jeff Layton --- include/linux/fs.h | 53 ++ 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index

[PATCH v2 02/89] fs: convert core infrastructure to new timestamp accessors

2023-10-06 Thread Jeff Layton
Convert the core vfs code to use the new timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/attr.c| 4 ++-- fs/bad_inode.c | 2 +- fs/binfmt_misc.c | 2 +- fs/inode.c | 35 +-- fs/nsfs.c| 2 +- fs/pipe.c| 2 +- fs

[PATCH v2 01/89] fs: new accessor methods for atime and mtime

2023-10-06 Thread Jeff Layton
atime and mtime that mirror the accessors for the ctime. Signed-off-by: Jeff Layton --- fs/libfs.c | 41 -- include/linux/fs.h | 85 +++--- 2 files changed, 102 insertions(+), 24 deletions(-) diff --git a/fs/libfs.c b/fs

[PATCH v2 00/89] fs: new accessor methods for inode atime and mtime

2023-10-06 Thread Jeff Layton
re feeling lucky). Jeff Layton (89): fs: new accessor methods for atime and mtime fs: convert core infrastructure to new timestamp accessors spufs: convert to new timestamp accessors hypfs: convert to new timestamp accessors android: convert to new timestamp accessors char: conv

Re: [PATCH 86/87] fs: switch timespec64 fields in inode to discrete integers

2023-10-06 Thread Jeff Layton
. FWIW, I'm planning to do a v2 patchbomb early next week, with the changes that Chuck suggested (specific helpers for fetching the _sec and _nsec fields). For now, I'll drop the change from timespec64 to discrete fields. We can do that in a separate follow-on set. -- Jeff Layton

Re: [PATCH 87/87] fs: move i_blocks up a few places in struct inode

2023-10-06 Thread Jeff Layton
On Thu, 2023-09-28 at 10:41 -0700, Linus Torvalds wrote: > On Thu, 28 Sept 2023 at 04:06, Jeff Layton wrote: > > > > Move i_blocks up above the i_lock, which moves the new 4 byte hole to > > just after the timestamps, without changing the size of the structure. >

Re: [PATCH 86/87] fs: switch timespec64 fields in inode to discrete integers

2023-10-06 Thread Jeff Layton
On Thu, 2023-09-28 at 10:19 -0700, Darrick J. Wong wrote: > On Thu, Sep 28, 2023 at 01:06:03PM -0400, Jeff Layton wrote: > > On Thu, 2023-09-28 at 11:48 -0400, Arnd Bergmann wrote: > > > On Thu, Sep 28, 2023, at 07:05, Jeff Layton wrote: > > > > This shaves 8 bytes

Re: [PATCH 86/87] fs: switch timespec64 fields in inode to discrete integers

2023-10-06 Thread Jeff Layton
On Thu, 2023-09-28 at 07:05 -0400, Jeff Layton wrote: > This shaves 8 bytes off struct inode, according to pahole. > > Signed-off-by: Jeff Layton > --- > include/linux/fs.h | 32 +++- > 1 file changed, 23 insertions(+), 9 deletions(-) > > di

Re: [PATCH 86/87] fs: switch timespec64 fields in inode to discrete integers

2023-10-06 Thread Jeff Layton
On Thu, 2023-09-28 at 11:48 -0400, Arnd Bergmann wrote: > On Thu, Sep 28, 2023, at 07:05, Jeff Layton wrote: > > This shaves 8 bytes off struct inode, according to pahole. > > > > Signed-off-by: Jeff Layton > > FWIW, this is similar to the approach that Dee

Re: [PATCH 87/87] fs: move i_blocks up a few places in struct inode

2023-10-06 Thread Jeff Layton
On Thu, 2023-09-28 at 14:35 +0300, Amir Goldstein wrote: > On Thu, Sep 28, 2023 at 2:06 PM Jeff Layton wrote: > > > > The recent change to use discrete integers instead of struct timespec64 > > in struct inode shaved 8 bytes off of it, but it also moves the i_lock > >

[PATCH 87/87] fs: move i_blocks up a few places in struct inode

2023-10-06 Thread Jeff Layton
timestamps, without changing the size of the structure. Signed-off-by: Jeff Layton --- include/linux/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index de902ff2938b..3e0fe0f52e7c 100644 --- a/include/linux/fs.h +++ b/include/linux

[PATCH 86/87] fs: switch timespec64 fields in inode to discrete integers

2023-10-06 Thread Jeff Layton
This shaves 8 bytes off struct inode, according to pahole. Signed-off-by: Jeff Layton --- include/linux/fs.h | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 831657011036..de902ff2938b 100644

[PATCH 01/87] fs: new accessor methods for atime and mtime

2023-10-06 Thread Jeff Layton
atime and mtime that mirror the accessors for the ctime. Signed-off-by: Jeff Layton --- fs/libfs.c | 13 + include/linux/fs.h | 42 ++ 2 files changed, 55 insertions(+) diff --git a/fs/libfs.c b/fs/libfs.c index 37f2d34ee090

[PATCH 85/87] fs: rename i_atime and i_mtime fields to __i_atime and __i_mtime

2023-10-06 Thread Jeff Layton
Make it clear that these fields are private now, and that the accessors should be used instead. Signed-off-by: Jeff Layton --- include/linux/fs.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 12d247b82aa0

[PATCH 00/87] fs: new accessor methods for atime and mtime

2023-10-06 Thread Jeff Layton
this conversion was done with coccinelle, with the rest done by hand with vim. Jeff Layton (87): fs: new accessor methods for atime and mtime fs: convert core infrastructure to new {a,m}time accessors arch/powerpc/platforms/cell/spufs: convert to new inode {a,m}time accessors arch/s390/

[PATCH v2 32/89] erofs: convert to new timestamp accessors

2023-10-04 Thread Jeff Layton
Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/erofs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index edc8ec7581b8..b8ad05b4509d 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs

[PATCH 31/87] fs/erofs: convert to new inode {a,m}time accessors

2023-09-28 Thread Jeff Layton
Signed-off-by: Jeff Layton --- fs/erofs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index edc8ec7581b8..b8ad05b4509d 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs/inode.c @@ -175,7 +175,8 @@ static void *erofs_read_inode(struct

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

2023-09-20 Thread Jeff Layton
need some time to ponder the options for this series anyway, and another cycle in next wouldn't hurt. The branch itself looks fine, but you might want to reverse the order of the patches in case someone lands there in the middle of a bisect. IOW, I think you want to revert the "convert to multigrain" patches before you revert the infrastructure. -- Jeff Layton

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

2023-09-20 Thread Jeff Layton
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 > > > finegrained timestamps + lazytime (if I n

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

2023-09-20 Thread Jeff Layton
; @Jan, what do you think? > > > My plan was to take a stab at doing this for a later kernel release. > > Ok. If it works out, then we may be able to eventually remove the mount option, but that is a separate project altogether. -- Jeff Layton

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

2023-09-20 Thread Jeff Layton
#x27;t a big deal regressions like this were always to be expected but > v6.6 needs to stabilize so anything that requires more significant work > is not an option. Oh, absolutely. I wasn't proposing to do that work for v6.6. For that, we absolutely either need the mount option or to just revert the mgtime conversions. My plan was to take a stab at doing this for a later kernel release. This is very much a "back to the drawing board" idea. It may not pan out after all, but if it does then we could consider removing the mount option at that point. -- Jeff Layton

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

2023-09-20 Thread Jeff Layton
request_mask, inode); > > } else { > > stat->mtime = inode->i_mtime; > > diff --git a/include/linux/fs.h b/include/linux/fs.h > > index 4aeb3fa11927..03e415fb3a7c 100644 > > --- a/include/linux/fs.h > > +++ b/include/linux/fs.h > > @@ -1114,6 +1114,7 @@ extern int send_sigurg(struct fown_struct *fown); > > #define SB_NODEVBIT(2) /* Disallow access to device special > > files */ > > #define SB_NOEXEC BIT(3) /* Disallow program execution */ > > #define SB_SYNCHRONOUS BIT(4) /* Writes are synced at once */ > > +#define SB_MGTIME BIT(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 times. */ > > @@ -2105,6 +2106,7 @@ static inline bool sb_rdonly(const struct super_block > > *sb) { return sb->s_flags > > ((inode)->i_flags & (S_SYNC|S_DIRSYNC))) > > #define IS_MANDLOCK(inode) __IS_FLG(inode, SB_MANDLOCK) > > #define IS_NOATIME(inode) __IS_FLG(inode, SB_RDONLY|SB_NOATIME) > > +#define IS_MGTIME(inode) __IS_FLG(inode, SB_MGTIME) > > #define IS_I_VERSION(inode)__IS_FLG(inode, SB_I_VERSION) > > > > #define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) > > @@ -2366,7 +2368,7 @@ struct file_system_type { > > */ > > static inline bool is_mgtime(const struct inode *inode) > > { > > - return inode->i_sb->s_type->fs_flags & FS_MGTIME; > > + return inode->i_sb->s_flags & SB_MGTIME; > > } > > > > extern struct dentry *mount_bdev(struct file_system_type *fs_type, > > -- > > 2.34.1 > > -- Jeff Layton

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

2023-09-20 Thread Jeff Layton
Directory modifications are > synchronous */ >  #define SB_NOATIME BIT(10) /* Do not update access times. */ > @@ -2105,6 +2106,7 @@ static inline bool sb_rdonly(const struct super_block > *sb) { return sb->s_flags >   ((inode)->i_flags & (S_SYNC|S_DIRSYNC))) >  #define IS_MANDLOCK(inode) __IS_FLG(inode, SB_MANDLOCK) >  #define IS_NOATIME(inode)__IS_FLG(inode, SB_RDONLY|SB_NOATIME) > +#define IS_MGTIME(inode) __IS_FLG(inode, SB_MGTIME) >  #define IS_I_VERSION(inode) __IS_FLG(inode, SB_I_VERSION) >   > >  #define IS_NOQUOTA(inode)((inode)->i_flags & S_NOQUOTA) > @@ -2366,7 +2368,7 @@ struct file_system_type { >   */ >  static inline bool is_mgtime(const struct inode *inode) >  { > - return inode->i_sb->s_type->fs_flags & FS_MGTIME; > + return inode->i_sb->s_flags & SB_MGTIME; >  } >   > >  extern struct dentry *mount_bdev(struct file_system_type *fs_type, The mount option looks reasonable. Thanks for throwing together the patch. Maybe in the future we can come up with a way to mitigate the problems and do this unconditionally? Reviewed-by: Jeff Layton

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

2023-09-19 Thread Jeff Layton
On Tue, 2023-09-19 at 13:10 -0700, Paul Eggert wrote: > On 2023-09-19 09:31, Jeff Layton wrote: > > The typical case for make > > timestamp comparisons is comparing source files vs. a build target. If > > those are being written nearly simultaneously, then that could be an >

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

2023-09-19 Thread Jeff Layton
On Tue, 2023-09-19 at 16:52 +0200, Bruno Haible wrote: > Jeff Layton wrote: > > I'm not sure what we can do for this test. The nap() function is making > > an assumption that the timestamp granularity will be constant, and that > > isn't necessarily the case now.

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

2023-09-19 Thread Jeff Layton
On Tue, 2023-09-19 at 13:04 +0200, Jan Kara wrote: > On Tue 19-09-23 15:05:24, Xi Ruoyao wrote: > > On Mon, 2023-08-07 at 15:38 -0400, Jeff Layton wrote: > > > Enable multigrain timestamps, which should ensure that there is an > > > apparent change to the timestamp w

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

2023-08-31 Thread Jeff Layton
On Wed, 2023-08-30 at 01:19 +0100, Al Viro wrote: > On Wed, Jul 05, 2023 at 02:58:11PM -0400, Jeff Layton wrote: > > > + * POSIX mandates that the old and new parent directories have their ctime > > and > > + * mtime updated, and that inodes of @old_dentry and @new_de

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

2023-08-29 Thread Jeff Layton
On Wed, 2023-08-30 at 01:02 +0100, Al Viro wrote: > On Tue, Aug 29, 2023 at 06:58:47PM -0400, Jeff Layton wrote: > > On Tue, 2023-08-29 at 23:44 +0100, Al Viro wrote: > > > On Tue, Jul 25, 2023 at 10:58:14AM -0400, Jeff Layton wrote: > > > > generic_fillattr just f

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

2023-08-29 Thread Jeff Layton
On Tue, 2023-08-29 at 23:44 +0100, Al Viro wrote: > On Tue, Jul 25, 2023 at 10:58:14AM -0400, Jeff Layton wrote: > > generic_fillattr just fills in the entire stat struct indiscriminately > > today, copying data from the inode. There is at least one attribute > > (STATX_CH

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

2023-08-09 Thread Jeff Layton
On Thu, 2023-08-10 at 05:14 +0900, OGAWA Hirofumi wrote: > Jeff Layton writes: > > > When you say it "doesn't work the same", what do you mean, specifically? > > I had to make some allowances for the fact that FAT is substantially > > different in its time

Re: [PATCH v7 08/13] fs: drop the timespec64 argument from update_time

2023-08-09 Thread Jeff Layton
h that has this in it? > > -Mike > > On Wed, Aug 9, 2023 at 8:32 AM Christian Brauner wrote: > > > > On Mon, Aug 07, 2023 at 03:38:39PM -0400, Jeff Layton wrote: > > > Now that all of the update_time operations are prepared for it, we can > > > drop the

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

2023-08-09 Thread Jeff Layton
On Thu, 2023-08-10 at 03:31 +0900, OGAWA Hirofumi wrote: > Jeff Layton writes: > > > On Thu, 2023-08-10 at 02:44 +0900, OGAWA Hirofumi wrote: > > > Jeff Layton writes: > > > > > That would be wrong. The problem is that we're changing how update_time &g

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

2023-08-09 Thread Jeff Layton
On Thu, 2023-08-10 at 02:44 +0900, OGAWA Hirofumi wrote: > Jeff Layton writes: > > > On Thu, 2023-08-10 at 00:17 +0900, OGAWA Hirofumi wrote: > > > Jan Kara writes: > > [...] > > > My mistake re: lazytime vs. relatime, but Jan is correct that thi

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

2023-08-09 Thread Jeff Layton
ore, even though it now fetches its own timestamps from the clock. Given the way that the mtime and ctime are smooshed together in FAT, that seemed reasonable. Is there a particular case or flag combination you're concerned about here? -- Jeff Layton

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

2023-08-09 Thread Jeff Layton
On Wed, 2023-08-09 at 22:36 +0900, OGAWA Hirofumi wrote: > Jeff Layton writes: > > > On Wed, 2023-08-09 at 17:37 +0900, OGAWA Hirofumi wrote: > > > Jeff Layton writes: > > > > > > > Also, it may be that things have changed by the time we get to call

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

2023-08-09 Thread Jeff Layton
On Wed, 2023-08-09 at 17:37 +0900, OGAWA Hirofumi wrote: > Jeff Layton writes: > > > Also, it may be that things have changed by the time we get to calling > > fat_update_time after checking inode_needs_update_time. Ensure that we > > attempt the i_version bump if any

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

2023-08-07 Thread Jeff Layton
stores. Just have it overwrite the timestamps unconditionally. Signed-off-by: Jeff Layton Acked-by: David Sterba --- fs/btrfs/file.c | 24 fs/btrfs/super.c | 5 +++-- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c

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

2023-08-07 Thread Jeff Layton
Enable multigrain timestamps, which should ensure that there is an apparent change to the timestamp whenever it has been written after being actively observed via getattr. For ext4, we only need to enable the FS_MGTIME flag. Acked-by: Theodore Ts'o Reviewed-by: Jan Kara Signed-off-by:

[PATCH v7 11/13] xfs: switch to multigrain timestamps

2023-08-07 Thread Jeff Layton
. Have that function unconditionally bump the ctime, and ASSERT that XFS_ICHGTIME_CHG is always set. Acked-by: "Darrick J. Wong" Signed-off-by: Jeff Layton --- fs/xfs/libxfs/xfs_trans_inode.c | 6 +++--- fs/xfs/xfs_iops.c | 8 fs/xfs/xfs_super.c | 2 +

[PATCH v7 10/13] tmpfs: add support for multigrain timestamps

2023-08-07 Thread Jeff Layton
Enable multigrain timestamps, which should ensure that there is an apparent change to the timestamp whenever it has been written after being actively observed via getattr. tmpfs only requires the FS_MGTIME flag. Reviewed-by: Jan Kara Signed-off-by: Jeff Layton --- mm/shmem.c | 2 +- 1 file

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

2023-08-07 Thread Jeff Layton
rse-grained one. Filesytems can opt into this behavior by setting the FS_MGTIME flag in the fstype. Filesystems 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 --- fs/

[PATCH v7 08/13] fs: drop the timespec64 argument from update_time

2023-08-07 Thread Jeff Layton
Now that all of the update_time operations are prepared for it, we can drop the timespec64 argument from the update_time operation. Do that and remove it from some associated functions like inode_update_time and inode_needs_update_time. Signed-off-by: Jeff Layton --- fs/bad_inode.c

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

2023-08-07 Thread Jeff Layton
In later patches we're going to drop the "now" parameter from the update_time operation. Prepare XFS for this by reworking how it fetches timestamps and sets them in the inode. Ensure that we update the ctime even if only S_MTIME is set. Signed-off-by: Jeff Layton --- fs/xfs/

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

2023-08-07 Thread Jeff Layton
In later patches, we're going to drop the "now" parameter from the update_time operation. Prepare ubifs for this, by having it use the new inode_update_timestamps helper. Signed-off-by: Jeff Layton --- fs/ubifs/file.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions

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

2023-08-07 Thread Jeff Layton
the time we get to calling fat_update_time after checking inode_needs_update_time. Ensure that we attempt the i_version bump if any of the S_* flags besides S_ATIME are set. Signed-off-by: Jeff Layton --- fs/fat/misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/fat/

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

2023-08-07 Thread Jeff Layton
In later patches, we're going to drop the "now" argument from the update_time operation. Have btrfs_update_time use the new inode_update_timestamps helper to fetch a new timestamp and update it properly. Signed-off-by: Jeff Layton --- fs/btrfs/inode.c | 9 + 1 file chang

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

2023-08-07 Thread Jeff Layton
some callers of generic_update_time need to know what timestamps were actually updated. Change it to return an S_* flag mask to indicate that and rework the callers to expect it. Signed-off-by: Jeff Layton --- fs/gfs2/inode.c | 3 +- fs/inode.c | 84 +-

[PATCH v7 02/13] fs: pass the request_mask to generic_fillattr

2023-08-07 Thread Jeff Layton
ed-by: "Paulo Alcantara (SUSE)" Reviewed-by: Jan Kara Signed-off-by: Jeff Layton --- fs/9p/vfs_inode.c | 4 ++-- fs/9p/vfs_inode_dotl.c | 4 ++-- fs/afs/inode.c | 2 +- fs/btrfs/inode.c| 2 +- fs/ceph/inode.c | 2 +- fs/coda/inode.c | 3 +

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

2023-08-07 Thread Jeff Layton
An inode with no superblock? Unpossible! Signed-off-by: Jeff Layton --- fs/inode.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index d4ab92233062..3fc251bfaf73 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -2495,12 +2495,6 @@ struct timespec64 current_time

[PATCH v7 00/13] fs: implement multigrain timestamps

2023-08-07 Thread Jeff Layton
be everything above this commit: 525deaeb2fbf gfs2: fix timestamp handling on quota inodes base-commit: cf22d118b89a09a0160586412160d89098f7c4c7 Signed-off-by: Jeff Layton --- Changes in v7: - change update_time operation to fetch the current time itself - don't modify current_time operat

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

2023-08-02 Thread Jeff Layton
On Wed, 2023-08-02 at 21:35 +0200, Jan Kara wrote: > On Tue 25-07-23 10:58:15, Jeff Layton wrote: > > The VFS always uses coarse-grained timestamps when updating the ctime > > and mtime after a change. This has the benefit of allowing filesystems > > to optimize away a lot m

Re: [PATCH v6 5/7] xfs: switch to multigrain timestamps

2023-08-02 Thread Jeff Layton
On Wed, 2023-08-02 at 10:48 -0700, Darrick J. Wong wrote: > On Tue, Jul 25, 2023 at 10:58:18AM -0400, Jeff Layton wrote: > > Enable multigrain timestamps, which should ensure that there is an > > apparent change to the timestamp whenever it has been written after > > being

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

2023-07-26 Thread Jeff Layton
On Wed, 2023-07-26 at 17:40 +0800, Joseph Qi wrote: > > On 7/25/23 10:58 PM, Jeff Layton wrote: > > generic_fillattr just fills in the entire stat struct indiscriminately > > today, copying data from the inode. There is at least one attribute > > (STATX_CHANGE_COOKIE) th

Re: [PATCH v6 3/7] tmpfs: bump the mtime/ctime/iversion when page becomes writeable

2023-07-26 Thread Jeff Layton
On Tue, 2023-07-25 at 18:39 -0700, Hugh Dickins wrote: > On Tue, 25 Jul 2023, Jeff Layton wrote: > > > Most filesystems that use the pagecache will update the mtime, ctime, > > and change attribute when a page becomes writeable. Add a page_mkwrite > > operation for tmpfs

[PATCH v6 7/7] btrfs: convert to multigrain timestamps

2023-07-25 Thread Jeff Layton
stores. Just have it overwrite the timestamps unconditionally. Signed-off-by: Jeff Layton --- fs/btrfs/file.c | 24 fs/btrfs/super.c | 5 +++-- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index d7a9ece7a40b

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

2023-07-25 Thread Jeff Layton
Enable multigrain timestamps, which should ensure that there is an apparent change to the timestamp whenever it has been written after being actively observed via getattr. For ext4, we only need to enable the FS_MGTIME flag. Signed-off-by: Jeff Layton --- fs/ext4/super.c | 2 +- 1 file changed

[PATCH v6 5/7] xfs: switch to multigrain timestamps

2023-07-25 Thread Jeff Layton
. Have that function unconditionally bump the ctime, and ASSERT that XFS_ICHGTIME_CHG is always set. Signed-off-by: Jeff Layton --- fs/xfs/libxfs/xfs_trans_inode.c | 6 +++--- fs/xfs/xfs_iops.c | 4 ++-- fs/xfs/xfs_super.c | 2 +- 3 files changed, 6 insertions(+), 6

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

2023-07-25 Thread Jeff Layton
Enable multigrain timestamps, which should ensure that there is an apparent change to the timestamp whenever it has been written after being actively observed via getattr. tmpfs only requires the FS_MGTIME flag. Signed-off-by: Jeff Layton --- mm/shmem.c | 2 +- 1 file changed, 1 insertion

[PATCH v6 3/7] tmpfs: bump the mtime/ctime/iversion when page becomes writeable

2023-07-25 Thread Jeff Layton
Most filesystems that use the pagecache will update the mtime, ctime, and change attribute when a page becomes writeable. Add a page_mkwrite operation for tmpfs and just use it to bump the mtime, ctime and change attribute. This fixes xfstest generic/080 on tmpfs. Signed-off-by: Jeff Layton

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

2023-07-25 Thread Jeff Layton
rse-grained one. Filesytems can opt into this behavior by setting the FS_MGTIME flag in the fstype. Filesystems 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 --- fs/

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

2023-07-25 Thread Jeff Layton
Add a request_mask argument to generic_fillattr and have most callers just pass in the value that is passed to getattr. Have other callers (e.g. ksmbd) just pass in STATX_BASIC_STATS. Also move the setting of STATX_CHANGE_COOKIE into generic_fillattr. Signed-off-by: Jeff Layton --- fs/9p/vfs_in

[PATCH v6 0/7] fs: implement multigrain timestamps

2023-07-25 Thread Jeff Layton
to linux-next. Christian, would you be willing to pick these up for now? Alternately, I can feed them there via the iversion branch that Stephen is already pulling in from my tree. Signed-off-by: Jeff Layton base-commit: cf22d118b89a09a0160586412160d89098f7c4c7 --- Changes in v6: - drop the

Re: [PATCH v2 35/47] nfsd: dynamically allocate the nfsd-reply shrinker

2023-07-24 Thread Jeff Layton
ntrol *sc) > { > - struct nfsd_net *nn = container_of(shrink, > - struct nfsd_net, nfsd_reply_cache_shrinker); > + struct nfsd_net *nn = shrink->private_data; > > return atomic_read(&nn->num_drc_entries); > } > @@ -342,8 +344,

Re: [PATCH v2 34/47] nfsd: dynamically allocate the nfsd-client shrinker

2023-07-24 Thread Jeff Layton
+ shrinker_register(nn->nfsd_client_shrinker); > + > return 0; > > err_shrinker: > @@ -8228,7 +8232,7 @@ nfs4_state_shutdown_net(struct net *net) > struct list_head *pos, *next, reaplist; > struct nfsd_net *nn = net_generic(net, nfsd_net_id); > > - unregister_shrinker(&nn->nfsd_client_shrinker); > + shrinker_unregister(nn->nfsd_client_shrinker); > cancel_work(&nn->nfsd_shrinker_work); > cancel_delayed_work_sync(&nn->laundromat_work); > locks_end_grace(&nn->nfsd4_manager); Acked-by: Jeff Layton

[PATCH v5 8/8] btrfs: convert to multigrain timestamps

2023-07-13 Thread Jeff Layton
stores. Just have it overwrite the timestamps unconditionally. Signed-off-by: Jeff Layton --- fs/btrfs/file.c | 24 fs/btrfs/super.c | 5 +++-- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index d7a9ece7a40b

[PATCH v5 7/8] ext4: switch to multigrain timestamps

2023-07-13 Thread Jeff Layton
Enable multigrain timestamps, which should ensure that there is an apparent change to the timestamp whenever it has been written after being actively observed via getattr. For ext4, we only need to enable the FS_MGTIME flag. Signed-off-by: Jeff Layton --- fs/ext4/super.c | 2 +- 1 file changed

[PATCH v5 6/8] xfs: switch to multigrain timestamps

2023-07-13 Thread Jeff Layton
. Have that function unconditionally bump the ctime, and warn if XFS_ICHGTIME_CHG is ever not set. Signed-off-by: Jeff Layton --- fs/xfs/libxfs/xfs_trans_inode.c | 6 +++--- fs/xfs/xfs_iops.c | 4 ++-- fs/xfs/xfs_super.c | 2 +- 3 files changed, 6 insertions(+), 6

[PATCH v5 5/8] xfs: XFS_ICHGTIME_CREATE is unused

2023-07-13 Thread Jeff Layton
Nothing ever sets this flag, which makes sense since the create time is set at inode instantiation and is never changed. Remove it and the handling of it in xfs_trans_ichgtime. Signed-off-by: Jeff Layton --- fs/xfs/libxfs/xfs_shared.h | 2 -- fs/xfs/libxfs/xfs_trans_inode.c | 2 -- 2 files

[PATCH v5 4/8] tmpfs: add support for multigrain timestamps

2023-07-13 Thread Jeff Layton
Enable multigrain timestamps, which should ensure that there is an apparent change to the timestamp whenever it has been written after being actively observed via getattr. tmpfs only requires the FS_MGTIME flag. Signed-off-by: Jeff Layton --- mm/shmem.c | 2 +- 1 file changed, 1 insertion

[PATCH v5 3/8] tmpfs: bump the mtime/ctime/iversion when page becomes writeable

2023-07-13 Thread Jeff Layton
Most filesystems that use the pagecache will update the mtime, ctime, and change attribute when a page becomes writeable. Add a page_mkwrite operation for tmpfs and just use it to bump the mtime, ctime and change attribute. This fixes xfstest generic/080 on tmpfs. Signed-off-by: Jeff Layton

[PATCH v5 2/8] fs: add infrastructure for multigrain timestamps

2023-07-13 Thread Jeff Layton
rse-grained one. Filesytems can opt into this behavior by setting the FS_MGTIME flag in the fstype. Filesystems 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 --- fs/

[PATCH v5 0/8] fs: implement multigrain timestamps

2023-07-13 Thread Jeff Layton
oking for feedback on the core infrastructure API. Does this look reasonable? Am I missing any races? Signed-off-by: Jeff Layton base-commit: cf22d118b89a09a0160586412160d89098f7c4c7 --- Jeff Layton (8): fs: pass the request_mask to generic_fillattr fs: add infrastructure for multigrai

[PATCH v5 1/8] fs: pass the request_mask to generic_fillattr

2023-07-13 Thread Jeff Layton
Add a request_mask argument to generic_fillattr and have most callers just pass in the value that is passed to getattr. Have other callers (e.g. ksmbd) just pass in STATX_BASIC_STATS. Also move the setting of STATX_CHANGE_COOKIE into generic_fillattr. Signed-off-by: Jeff Layton --- fs/9p/vfs_in

Re: [PATCH v2 00/89] fs: new accessors for inode->i_ctime

2023-07-10 Thread Jeff Layton
On Mon, 2023-07-10 at 14:35 +0200, Christian Brauner wrote: > On Fri, Jul 07, 2023 at 08:42:31AM -0400, Jeff Layton wrote: > > On Wed, 2023-07-05 at 14:58 -0400, Jeff Layton wrote: > > > v2: > > > - prepend patches to add missing ctime updates > > > - add sim

  1   2   >