diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-09-05 15:52:51 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-09-05 18:11:42 -0400 |
commit | 0f1d26055068bbc66751d1974ecc6f0398b3ac67 (patch) | |
tree | 998b5e200cd6a519a39b80c43516895a2cc91519 /fs/nfs/write.c | |
parent | 8897538e97ed80570f6e3befc41ca0288b776799 (diff) | |
download | linux-0f1d26055068bbc66751d1974ecc6f0398b3ac67.tar.bz2 |
NFS: Don't check lock owner compatibility in writes unless file is locked
If we're doing buffered writes, and there is no file locking involved,
then we don't have to worry about whether or not the lock owner information
is identical.
By relaxing this check, we ensure that fork()ed child processes can write
to a page without having to first sync dirty data that was written
by the parent to disk.
Reported-by: Quentin Barnes <qbarnes@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Tested-by: Quentin Barnes <qbarnes@gmail.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 40979e815434..ac1dc331ba31 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -863,7 +863,7 @@ int nfs_flush_incompatible(struct file *file, struct page *page) return 0; l_ctx = req->wb_lock_context; do_flush = req->wb_page != page || req->wb_context != ctx; - if (l_ctx) { + if (l_ctx && ctx->dentry->d_inode->i_flock != NULL) { do_flush |= l_ctx->lockowner.l_owner != current->files || l_ctx->lockowner.l_pid != current->tgid; } |