Commit e8e058e8 authored by Trond Myklebust's avatar Trond Myklebust

NFS: Fix nfs_sync_inode_wait(FLUSH_INVALIDATE)

Currently nfs_sync_inode_wait() will fail to loop correctly when we call
nfs_sync_inode_wait with the FLUSH_INVALIDATE argument.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent cf1308ff
...@@ -1525,9 +1525,10 @@ int nfs_sync_inode_wait(struct inode *inode, unsigned long idx_start, ...@@ -1525,9 +1525,10 @@ int nfs_sync_inode_wait(struct inode *inode, unsigned long idx_start,
pages = nfs_scan_dirty(inode, &head, idx_start, npages); pages = nfs_scan_dirty(inode, &head, idx_start, npages);
if (pages != 0) { if (pages != 0) {
spin_unlock(&nfsi->req_lock); spin_unlock(&nfsi->req_lock);
if (how & FLUSH_INVALIDATE) if (how & FLUSH_INVALIDATE) {
nfs_cancel_dirty_list(&head); nfs_cancel_dirty_list(&head);
else ret = pages;
} else
ret = nfs_flush_list(inode, &head, pages, how); ret = nfs_flush_list(inode, &head, pages, how);
spin_lock(&nfsi->req_lock); spin_lock(&nfsi->req_lock);
continue; continue;
...@@ -1540,6 +1541,7 @@ int nfs_sync_inode_wait(struct inode *inode, unsigned long idx_start, ...@@ -1540,6 +1541,7 @@ int nfs_sync_inode_wait(struct inode *inode, unsigned long idx_start,
if (how & FLUSH_INVALIDATE) { if (how & FLUSH_INVALIDATE) {
spin_unlock(&nfsi->req_lock); spin_unlock(&nfsi->req_lock);
nfs_cancel_commit_list(&head); nfs_cancel_commit_list(&head);
ret = pages;
spin_lock(&nfsi->req_lock); spin_lock(&nfsi->req_lock);
continue; continue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment