mbox series

[vfs.tmpfs,0/5] tmpfs: user xattrs and direct IO

Message ID e92a4d33-f97-7c84-95ad-4fed8e84608c@google.com (mailing list archive)
Headers show
Series tmpfs: user xattrs and direct IO | expand

Message

Hugh Dickins Aug. 9, 2023, 4:28 a.m. UTC
This series enables and limits user extended attributes on tmpfs,
and independently provides a trivial direct IO stub for tmpfs.

It is here based on the vfs.tmpfs branch in vfs.git in next-20230808
but with a cherry-pick of v6.5-rc4's commit
253e5df8b8f0 ("tmpfs: fix Documentation of noswap and huge mount options")
first: since the vfs.tmpfs branch is based on v6.5-rc1, but 3/5 in this
series updates tmpfs.rst in a way which depends on that commit.

IIUC the right thing to do would be to cherry-pick 253e5df8b8f0 into
vfs.tmpfs before applying this series.  I'm sorry that the series as
posted does not apply cleanly to any known tree! but I think posting
it against v6.5-rc5 or next-20230808 would be even less helpful.

There is one "conflict" between this series and the final next-20230808:
Jeff Layton's vfs.ctime mods update a line of shmem_xattr_handler_set(),
where neighbouring lines are modified by 1/5 and 3/5 here: easily
resolved in the merge commit, I hope.

1/5 xattr: simple_xattr_set() return old_xattr to be freed
2/5 tmpfs: track free_ispace instead of free_inodes
3/5 tmpfs,xattr: enable limited user extended attributes
4/5 tmpfs: trivial support for direct IO
5/5 mm: invalidation check mapping before folio_contains

 Documentation/filesystems/tmpfs.rst |   7 +-
 fs/Kconfig                          |   4 +-
 fs/kernfs/dir.c                     |   2 +-
 fs/kernfs/inode.c                   |  46 +++++++----
 fs/xattr.c                          |  79 +++++++++++-------
 include/linux/shmem_fs.h            |   2 +-
 include/linux/xattr.h               |  10 ++-
 mm/shmem.c                          | 130 +++++++++++++++++++++++-------
 mm/truncate.c                       |   4 +-
 9 files changed, 197 insertions(+), 87 deletions(-)

Hugh

Comments

Christian Brauner Aug. 9, 2023, 6:45 a.m. UTC | #1
On Tue, Aug 08, 2023 at 09:28:08PM -0700, Hugh Dickins wrote:
> This series enables and limits user extended attributes on tmpfs,
> and independently provides a trivial direct IO stub for tmpfs.
> 
> It is here based on the vfs.tmpfs branch in vfs.git in next-20230808
> but with a cherry-pick of v6.5-rc4's commit
> 253e5df8b8f0 ("tmpfs: fix Documentation of noswap and huge mount options")
> first: since the vfs.tmpfs branch is based on v6.5-rc1, but 3/5 in this
> series updates tmpfs.rst in a way which depends on that commit.
> 
> IIUC the right thing to do would be to cherry-pick 253e5df8b8f0 into
> vfs.tmpfs before applying this series.  I'm sorry that the series as
> posted does not apply cleanly to any known tree! but I think posting
> it against v6.5-rc5 or next-20230808 would be even less helpful.

No worries, I'll sort that out.

> 
> There is one "conflict" between this series and the final next-20230808:
> Jeff Layton's vfs.ctime mods update a line of shmem_xattr_handler_set(),
> where neighbouring lines are modified by 1/5 and 3/5 here: easily
> resolved in the merge commit, I hope.

Yeah, git rerere is our friend here as well so reassembling the tree
isn't really that much pain.
Christian Brauner Aug. 9, 2023, 11:33 a.m. UTC | #2
On Wed, Aug 09, 2023 at 08:45:57AM +0200, Christian Brauner wrote:
> On Tue, Aug 08, 2023 at 09:28:08PM -0700, Hugh Dickins wrote:
> > This series enables and limits user extended attributes on tmpfs,
> > and independently provides a trivial direct IO stub for tmpfs.
> > 
> > It is here based on the vfs.tmpfs branch in vfs.git in next-20230808
> > but with a cherry-pick of v6.5-rc4's commit
> > 253e5df8b8f0 ("tmpfs: fix Documentation of noswap and huge mount options")
> > first: since the vfs.tmpfs branch is based on v6.5-rc1, but 3/5 in this
> > series updates tmpfs.rst in a way which depends on that commit.
> > 
> > IIUC the right thing to do would be to cherry-pick 253e5df8b8f0 into
> > vfs.tmpfs before applying this series.  I'm sorry that the series as
> > posted does not apply cleanly to any known tree! but I think posting
> > it against v6.5-rc5 or next-20230808 would be even less helpful.
> 
> No worries, I'll sort that out.

So, I hemmed and hawed but decided to rebase vfs.tmpfs onto v6.5-rc4
which includes that fix as cherry picking is odd.
Hugh Dickins Aug. 10, 2023, 5:50 a.m. UTC | #3
On Wed, 9 Aug 2023, Christian Brauner wrote:
> On Wed, Aug 09, 2023 at 08:45:57AM +0200, Christian Brauner wrote:
> > On Tue, Aug 08, 2023 at 09:28:08PM -0700, Hugh Dickins wrote:
> > > This series enables and limits user extended attributes on tmpfs,
> > > and independently provides a trivial direct IO stub for tmpfs.
> > > 
> > > It is here based on the vfs.tmpfs branch in vfs.git in next-20230808
> > > but with a cherry-pick of v6.5-rc4's commit
> > > 253e5df8b8f0 ("tmpfs: fix Documentation of noswap and huge mount options")
> > > first: since the vfs.tmpfs branch is based on v6.5-rc1, but 3/5 in this
> > > series updates tmpfs.rst in a way which depends on that commit.
> > > 
> > > IIUC the right thing to do would be to cherry-pick 253e5df8b8f0 into
> > > vfs.tmpfs before applying this series.  I'm sorry that the series as
> > > posted does not apply cleanly to any known tree! but I think posting
> > > it against v6.5-rc5 or next-20230808 would be even less helpful.
> > 
> > No worries, I'll sort that out.
> 
> So, I hemmed and hawed but decided to rebase vfs.tmpfs onto v6.5-rc4
> which includes that fix as cherry picking is odd.

Even better, thanks.

And big thank you to you and Jan and Carlos for the very quick and
welcoming reviews.  If only Hugh were able to respond like that...

Needing "freed = 0" in shmem_evict_inode(), as reported by robot:
that was stupid of me (though it happens not to matter what the value
is in the uninitialized case): I'll send you the fixup to 3/5 tomorrow
(unless it turns out that you've typed in the " = 0" yourself already).

And I'll send a replacement for 4/5, the direct IO one, following
Christoph's guidance: but I'm wilting, and just didn't get to it today.

Hugh
Christian Brauner Aug. 10, 2023, 10:07 a.m. UTC | #4
On Wed, Aug 09, 2023 at 10:50:39PM -0700, Hugh Dickins wrote:
> On Wed, 9 Aug 2023, Christian Brauner wrote:
> > On Wed, Aug 09, 2023 at 08:45:57AM +0200, Christian Brauner wrote:
> > > On Tue, Aug 08, 2023 at 09:28:08PM -0700, Hugh Dickins wrote:
> > > > This series enables and limits user extended attributes on tmpfs,
> > > > and independently provides a trivial direct IO stub for tmpfs.
> > > > 
> > > > It is here based on the vfs.tmpfs branch in vfs.git in next-20230808
> > > > but with a cherry-pick of v6.5-rc4's commit
> > > > 253e5df8b8f0 ("tmpfs: fix Documentation of noswap and huge mount options")
> > > > first: since the vfs.tmpfs branch is based on v6.5-rc1, but 3/5 in this
> > > > series updates tmpfs.rst in a way which depends on that commit.
> > > > 
> > > > IIUC the right thing to do would be to cherry-pick 253e5df8b8f0 into
> > > > vfs.tmpfs before applying this series.  I'm sorry that the series as
> > > > posted does not apply cleanly to any known tree! but I think posting
> > > > it against v6.5-rc5 or next-20230808 would be even less helpful.
> > > 
> > > No worries, I'll sort that out.
> > 
> > So, I hemmed and hawed but decided to rebase vfs.tmpfs onto v6.5-rc4
> > which includes that fix as cherry picking is odd.
> 
> Even better, thanks.
> 
> And big thank you to you and Jan and Carlos for the very quick and
> welcoming reviews.

Happy to.

> Needing "freed = 0" in shmem_evict_inode(), as reported by robot:

Fixed that.

> And I'll send a replacement for 4/5, the direct IO one, following

Ah great, thanks!
Pete Zaitcev Aug. 10, 2023, 11:23 p.m. UTC | #5
On Wed, 9 Aug 2023 22:50:39 -0700 (PDT)
Hugh Dickins <hughd@google.com> wrote:

> And big thank you to you and Jan and Carlos for the very quick and
> welcoming reviews.  If only Hugh were able to respond like that...

No negative self-talk. My own naive submission was sitting in my
mailbox since February 2020, so at least you're doing it! Seriously,
thanks a lot for finding the cycles.

-- Pete