nfsd4: don't set lock stateid's sc_type to CLOSED

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/2502072058b35e2297f4ad7b211a45ad95a6a3d5
Commit:     2502072058b35e2297f4ad7b211a45ad95a6a3d5
Parent:     4f1764172a0aa7395d12b96cae640ca1438c5085
Refname:    refs/heads/master
Author:     J. Bruce Fields <[email protected]>
AuthorDate: Wed Jan 17 16:25:59 2018 -0500
Committer:  J. Bruce Fields <[email protected]>
CommitDate: Mon Feb 5 17:13:17 2018 -0500

    nfsd4: don't set lock stateid's sc_type to CLOSED
    
    There's no point I can see to
    
            stp->st_stid.sc_type = NFS4_CLOSED_STID;
    
    given release_lock_stateid immediately sets sc_type to 0.
    
    That set of sc_type to 0 should be enough to prevent it being used where
    we don't want it to be; NFS4_CLOSED_STID should only be needed for
    actual open stateid's that are actually closed.
    
    Signed-off-by: J. Bruce Fields <[email protected]>
---
 fs/nfsd/nfs4state.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 5a75135f5f53..150521c9671b 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -5183,7 +5183,6 @@ nfsd4_free_lock_stateid(stateid_t *stateid, struct nfs4_stid *s)
 			    lockowner(stp->st_stateowner)))
 		goto out;
 
-	stp->st_stid.sc_type = NFS4_CLOSED_STID;
 	release_lock_stateid(stp);
 	ret = nfs_ok;
 
@@ -6079,10 +6078,8 @@ out:
 		 * If this is a new, never-before-used stateid, and we are
 		 * returning an error, then just go ahead and release it.
 		 */
-		if (status && new) {
-			lock_stp->st_stid.sc_type = NFS4_CLOSED_STID;
+		if (status && new)
 			release_lock_stateid(lock_stp);
-		}
 
 		mutex_unlock(&lock_stp->st_mutex);
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.