Skip to content

Commit

Permalink
NFS: Don't check lock owner compatibility in writes unless file is lo…
Browse files Browse the repository at this point in the history
…cked

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>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Sep 5, 2013
1 parent 8897538 commit 0f1d260
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0f1d260

Please sign in to comment.