All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfsd: ensure that st_access_bmap and st_deny_bmap are initialized to 0
@ 2014-07-23 17:46 Jeff Layton
  2014-07-23 20:48 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2014-07-23 17:46 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, hch

Open stateids must be initialized with the st_access_bmap and
st_deny_bmap set to 0, so that nfs4_get_vfs_file can properly record
their state in old_access_bmap and old_deny_bmap.

This bug was introduced in commit baeb4ff0e502 (nfsd: make deny mode
enforcement more efficient and close races in it) and was causing the
refcounts to end up incorrect when nfs4_get_vfs_file returned an error
after bumping the refcounts. This made it impossible to unmount the
underlying filesystem after running pynfs tests that involve deny modes.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
---
 fs/nfsd/nfs4state.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 72da0d44e66b..ce07e9517a80 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2968,8 +2968,6 @@ static void init_open_stateid(struct nfs4_ol_stateid *stp, struct nfs4_file *fp,
 	stp->st_file = fp;
 	stp->st_access_bmap = 0;
 	stp->st_deny_bmap = 0;
-	set_access(open->op_share_access, stp);
-	set_deny(open->op_share_deny, stp);
 	stp->st_openstp = NULL;
 	spin_lock(&fp->fi_lock);
 	list_add(&stp->st_perfile, &fp->fi_stateids);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nfsd: ensure that st_access_bmap and st_deny_bmap are initialized to 0
  2014-07-23 17:46 [PATCH] nfsd: ensure that st_access_bmap and st_deny_bmap are initialized to 0 Jeff Layton
@ 2014-07-23 20:48 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2014-07-23 20:48 UTC (permalink / raw)
  To: Jeff Layton; +Cc: linux-nfs, hch

On Wed, Jul 23, 2014 at 01:46:49PM -0400, Jeff Layton wrote:
> Open stateids must be initialized with the st_access_bmap and
> st_deny_bmap set to 0, so that nfs4_get_vfs_file can properly record
> their state in old_access_bmap and old_deny_bmap.
> 
> This bug was introduced in commit baeb4ff0e502 (nfsd: make deny mode
> enforcement more efficient and close races in it) and was causing the
> refcounts to end up incorrect when nfs4_get_vfs_file returned an error
> after bumping the refcounts. This made it impossible to unmount the
> underlying filesystem after running pynfs tests that involve deny modes.

Thanks, applied.--b.

> 
> Signed-off-by: Jeff Layton <jlayton@primarydata.com>
> ---
>  fs/nfsd/nfs4state.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 72da0d44e66b..ce07e9517a80 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -2968,8 +2968,6 @@ static void init_open_stateid(struct nfs4_ol_stateid *stp, struct nfs4_file *fp,
>  	stp->st_file = fp;
>  	stp->st_access_bmap = 0;
>  	stp->st_deny_bmap = 0;
> -	set_access(open->op_share_access, stp);
> -	set_deny(open->op_share_deny, stp);
>  	stp->st_openstp = NULL;
>  	spin_lock(&fp->fi_lock);
>  	list_add(&stp->st_perfile, &fp->fi_stateids);
> -- 
> 1.9.3
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-23 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23 17:46 [PATCH] nfsd: ensure that st_access_bmap and st_deny_bmap are initialized to 0 Jeff Layton
2014-07-23 20:48 ` J. Bruce Fields

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.