diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2021-06-21 11:39:14 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2021-06-29 13:13:34 -0400 |
commit | e9e8ee40b37af80626236517d6b7f110526bf2ff (patch) | |
tree | aea6c0b3440b38ed03ccff02c1f8577c1e746029 /fs/nfs/inode.c | |
parent | 5483b904bf336948826594610af4c9bbb0d9e3aa (diff) | |
parent | df2c7b951f439a0342495a4a049d808f679c474c (diff) |
Merge branch 'leases-devel'
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 2824acfe4ff9..853213b3a209 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -1101,6 +1101,7 @@ EXPORT_SYMBOL_GPL(nfs_inode_attach_open_context); void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx) { filp->private_data = get_nfs_open_context(ctx); + set_bit(NFS_CONTEXT_FILE_OPEN, &ctx->flags); if (list_empty(&ctx->list)) nfs_inode_attach_open_context(ctx); } @@ -1120,6 +1121,8 @@ struct nfs_open_context *nfs_find_open_context(struct inode *inode, const struct continue; if ((pos->mode & (FMODE_READ|FMODE_WRITE)) != mode) continue; + if (!test_bit(NFS_CONTEXT_FILE_OPEN, &pos->flags)) + continue; ctx = get_nfs_open_context(pos); if (ctx) break; @@ -1135,6 +1138,7 @@ void nfs_file_clear_open_context(struct file *filp) if (ctx) { struct inode *inode = d_inode(ctx->dentry); + clear_bit(NFS_CONTEXT_FILE_OPEN, &ctx->flags); /* * We fatal error on write before. Try to writeback * every page again. |