]> git.baikalelectronics.ru Git - kernel.git/commitdiff
NFS: nfs_find_open_context() should use cred_fscmp()
authorTrond Myklebust <trondmy@gmail.com>
Sun, 26 Jan 2020 22:31:15 +0000 (17:31 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Mon, 3 Feb 2020 21:35:07 +0000 (16:35 -0500)
We want to find open contexts that match our filesystem access
properties. They don't have to exactly match the cred.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/inode.c

index 71dfc9d2fc3d3194efec2000a5d2ef9d66bddb6a..1309e6f47f3d69e3d8f24d466a15814aa03fff28 100644 (file)
@@ -1061,7 +1061,7 @@ struct nfs_open_context *nfs_find_open_context(struct inode *inode, const struct
 
        rcu_read_lock();
        list_for_each_entry_rcu(pos, &nfsi->open_files, list) {
-               if (cred != NULL && pos->cred != cred)
+               if (cred != NULL && cred_fscmp(pos->cred, cred) != 0)
                        continue;
                if ((pos->mode & (FMODE_READ|FMODE_WRITE)) != mode)
                        continue;