diff mbox series

[for-6.13,03/19] nfs/localio: remove redundant suid/sgid handling

Message ID 20241108234002.16392-4-snitzer@kernel.org (mailing list archive)
State New
Headers show
Series nfs/nfsd: fixes and improvements for LOCALIO | expand

Commit Message

Mike Snitzer Nov. 8, 2024, 11:39 p.m. UTC
From: Mike Snitzer <snitzer@hammerspace.com>

nfs_writeback_done() will take care of suid/sgid corner case.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
---
 fs/nfs/localio.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

NeilBrown Nov. 11, 2024, 1:09 a.m. UTC | #1
On Sat, 09 Nov 2024, Mike Snitzer wrote:
> From: Mike Snitzer <snitzer@hammerspace.com>
> 
> nfs_writeback_done() will take care of suid/sgid corner case.

The code removed is from nfs_local_write_done().
That is called only in nfs_local_call_write() and nfs_local_pgio_release
is called shortly afterwards.  That calls nfs_local_hdr_release() which
calls ->rpc_call_done which will be nfs_pgio_result (or something that
eventually calls nfs_pgio_result via some other ->rpc_call_done)
nfs_pgio_result calls ->rw_done which will be nfs_writeback_done which,
as you say, already contains that code.

So it looks good.

Reviewed-by: NeilBrown <neilb@suse.de>

Thanks,
NeilBrown

> 
> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
> ---
>  fs/nfs/localio.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/fs/nfs/localio.c b/fs/nfs/localio.c
> index 637528e6368e..4b24933093b6 100644
> --- a/fs/nfs/localio.c
> +++ b/fs/nfs/localio.c
> @@ -527,12 +527,7 @@ nfs_local_write_done(struct nfs_local_kiocb *iocb, long status)
>  	}
>  	if (status < 0)
>  		nfs_reset_boot_verifier(inode);
> -	else if (nfs_should_remove_suid(inode)) {
> -		/* Deal with the suid/sgid bit corner case */
> -		spin_lock(&inode->i_lock);
> -		nfs_set_cache_invalid(inode, NFS_INO_INVALID_MODE);
> -		spin_unlock(&inode->i_lock);
> -	}
> +
>  	nfs_local_pgio_done(hdr, status);
>  }
>  
> -- 
> 2.44.0
> 
>
diff mbox series

Patch

diff --git a/fs/nfs/localio.c b/fs/nfs/localio.c
index 637528e6368e..4b24933093b6 100644
--- a/fs/nfs/localio.c
+++ b/fs/nfs/localio.c
@@ -527,12 +527,7 @@  nfs_local_write_done(struct nfs_local_kiocb *iocb, long status)
 	}
 	if (status < 0)
 		nfs_reset_boot_verifier(inode);
-	else if (nfs_should_remove_suid(inode)) {
-		/* Deal with the suid/sgid bit corner case */
-		spin_lock(&inode->i_lock);
-		nfs_set_cache_invalid(inode, NFS_INO_INVALID_MODE);
-		spin_unlock(&inode->i_lock);
-	}
+
 	nfs_local_pgio_done(hdr, status);
 }