2023-10-10 12:49:47

by Jeff Layton

[permalink] [raw]
Subject: missing patches for v6.6-rc

Hi Anna,

There are a couple of client side patches that I think we want in v6.6,
but that haven't shown up in linux-next yet. Do you still plan to take
these from Dai and Scott?

[PATCH 1/1] NFS: Fix potential oops in nfs_inode_remove_request()
[PATCH v3 1/1] nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op

Thanks,
--
Jeff Layton <[email protected]>


2023-10-11 13:56:00

by Anna Schumaker

[permalink] [raw]
Subject: Re: missing patches for v6.6-rc

Hi Jeff,

On Tue, Oct 10, 2023 at 8:49 AM Jeff Layton <[email protected]> wrote:
>
> Hi Anna,
>
> There are a couple of client side patches that I think we want in v6.6,
> but that haven't shown up in linux-next yet. Do you still plan to take
> these from Dai and Scott?

I've pushed out Dai's patch to my linux-next branch, and I can do
another pull request before the end of the 6.6 cycle. Is Scott's patch
still needed after your patch "nfs: decrement nrequests counter before
releasing the req" which went into 6.6-rc5? If so, it doesn't apply
cleanly on top of the current code so I'll need to fix it up.

Anna

>
> [PATCH 1/1] NFS: Fix potential oops in nfs_inode_remove_request()
> [PATCH v3 1/1] nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op
>
> Thanks,
> --
> Jeff Layton <[email protected]>

2023-10-11 14:02:53

by Benjamin Coddington

[permalink] [raw]
Subject: Re: missing patches for v6.6-rc

On 11 Oct 2023, at 9:55, Anna Schumaker wrote:

> Hi Jeff,
>
> On Tue, Oct 10, 2023 at 8:49 AM Jeff Layton <[email protected]> wrote:
>>
>> Hi Anna,
>>
>> There are a couple of client side patches that I think we want in v6.6,
>> but that haven't shown up in linux-next yet. Do you still plan to take
>> these from Dai and Scott?
>
> I've pushed out Dai's patch to my linux-next branch, and I can do
> another pull request before the end of the 6.6 cycle. Is Scott's patch
> still needed after your patch "nfs: decrement nrequests counter before
> releasing the req" which went into 6.6-rc5? If so, it doesn't apply
> cleanly on top of the current code so I'll need to fix it up.

Yes, that patch is definitely needed.

Want me to send a current version?

Ben

2023-10-11 14:04:30

by Anna Schumaker

[permalink] [raw]
Subject: Re: missing patches for v6.6-rc

On Wed, Oct 11, 2023 at 10:01 AM Benjamin Coddington
<[email protected]> wrote:
>
> On 11 Oct 2023, at 9:55, Anna Schumaker wrote:
>
> > Hi Jeff,
> >
> > On Tue, Oct 10, 2023 at 8:49 AM Jeff Layton <[email protected]> wrote:
> >>
> >> Hi Anna,
> >>
> >> There are a couple of client side patches that I think we want in v6.6,
> >> but that haven't shown up in linux-next yet. Do you still plan to take
> >> these from Dai and Scott?
> >
> > I've pushed out Dai's patch to my linux-next branch, and I can do
> > another pull request before the end of the 6.6 cycle. Is Scott's patch
> > still needed after your patch "nfs: decrement nrequests counter before
> > releasing the req" which went into 6.6-rc5? If so, it doesn't apply
> > cleanly on top of the current code so I'll need to fix it up.
>
> Yes, that patch is definitely needed.
>
> Want me to send a current version?

Sure! That would be great!

Anna

>
> Ben
>

2023-10-11 14:44:24

by Benjamin Coddington

[permalink] [raw]
Subject: [PATCH] NFS: Fix potential oops in nfs_inode_remove_request()

From: Scott Mayhew <[email protected]>

Once a folio's private data has been cleared, it's possible for another
process to clear the folio->mapping (e.g. via invalidate_complete_folio2
or evict_mapping_folio), so it wouldn't be safe to call
nfs_page_to_inode() after that.

Fixes: 0c493b5cf16e ("NFS: Convert buffered writes to use folios")
Signed-off-by: Scott Mayhew <[email protected]>
Reviewed-by: Benjamin Coddington <[email protected]>
Tested-by: Benjamin Coddington <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
---
fs/nfs/write.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 7720b5e43014..9d82d50ce0b1 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -788,6 +788,8 @@ static void nfs_inode_add_request(struct nfs_page *req)
*/
static void nfs_inode_remove_request(struct nfs_page *req)
{
+ struct nfs_inode *nfsi = NFS_I(nfs_page_to_inode(req));
+
if (nfs_page_group_sync_on_bit(req, PG_REMOVE)) {
struct folio *folio = nfs_page_to_folio(req->wb_head);
struct address_space *mapping = folio_file_mapping(folio);
@@ -802,7 +804,7 @@ static void nfs_inode_remove_request(struct nfs_page *req)
}

if (test_and_clear_bit(PG_INODE_REF, &req->wb_flags)) {
- atomic_long_dec(&NFS_I(nfs_page_to_inode(req))->nrequests);
+ atomic_long_dec(&nfsi->nrequests);
nfs_release_request(req);
}
}
--
2.41.0