Re: [PATCH 7/7] nfsd4: share_access_to_flags should consider only nfs4.x share_access flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 19, 2011 at 07:13:37PM -0700, Benny Halevy wrote:
> From: Benny Halevy <bhalevy@xxxxxxxxxx>
> 
> Currently, it will not correctl ignore and nfsv4.1 signal flags if the client
> sends them.

Good catch, but since b6d2f1ca3c1162f51098969e9c52fd099720416a "nfsd4:
more robust ignoring of WANT bits in OPEN" we're actually doing this
right from the start, and this is redundant.

(And remembering to mask out the other bits on every use is so
error-prone, I'm wondering if we should actually put the other bits in a
separate field entirely.  Either that or maybe provide a little helper
function to get the access bits and ensure they're never accessed any
other way.)

--b.

> 
> Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxx>
> ---
>  fs/nfsd/nfs4state.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 5c3377c..a687e1a 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -2555,7 +2555,7 @@ static __be32 nfsd4_check_seqid(struct nfsd4_compound_state *cstate, struct nfs4
>  
>  static int share_access_to_flags(u32 share_access)
>  {
> -	share_access &= ~NFS4_SHARE_WANT_MASK;
> +	share_access &= NFS4_SHARE_ACCESS_MASK;
>  
>  	return share_access == NFS4_SHARE_ACCESS_READ ? RD_STATE : WR_STATE;
>  }
> -- 
> 1.7.6
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux