nfsd: ensure that st_access_bmap and st_deny_bmap are initialized to 0
Subsystems (2)
PATCH 1/1 nfsd: ensure that st_access_bmap and st_deny_bmap are initialized to 0
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.
--- fs/nfsd/nfs4state.c | 2 -- 1 file changed, 2 deletions(-)
fs/nfsd/nfs4state.c +0 -2
@@ -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);
Signature · 1 line
1.9.3
J. Bruce Fields
AppliedQuoted 9 lines · Jeff Layton
Open stateids must be initialized with the
st_access_bmapandst_deny_bmapset to 0, so thatnfs4_get_vfs_filecan properly record their state inold_access_bmapandold_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 whennfs4_get_vfs_filereturned 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.
Quoted 22 lines
Signed-off-by Jeff Layton <[email protected]>--- fs/nfsd/nfs4state.c | 2 -- 1 file changed, 2 deletions(-)fs/nfsd/nfs4state.c +0
-2@@ -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);Signature · 1 line
1.9.3