NFS: Remove redundant waits for O_DIRECT in fsync() and write_begin()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 23 Jun 2016 13:55:48 +0000 (09:55 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 5 Jul 2016 23:11:05 +0000 (19:11 -0400)
We're now waiting immediately after taking the locks, so waiting
in fsync() and write_begin() is either redundant or potentially
subject to livelock (if not holding the lock).

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/file.c

index 9f8da9e1b23f80a8b732004549892e6f65c6ff3b..0e9b4a068f13ebebc4a4e076fc2e5d1a90b96ab9 100644 (file)
@@ -276,7 +276,6 @@ nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
 
        trace_nfs_fsync_enter(inode);
 
-       inode_dio_wait(inode);
        do {
                ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
                if (ret != 0)
@@ -361,11 +360,6 @@ static int nfs_write_begin(struct file *file, struct address_space *mapping,
                file, mapping->host->i_ino, len, (long long) pos);
 
 start:
-       /*
-        * Wait for O_DIRECT to complete
-        */
-       inode_dio_wait(mapping->host);
-
        page = grab_cache_page_write_begin(mapping, index, flags);
        if (!page)
                return -ENOMEM;