diff options
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 1ce0c200df16..9449b6835509 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1377,22 +1377,23 @@ int nfs_commit_inode(struct inode *inode, int how) | |||
1377 | int nfs_sync_inode(struct inode *inode, unsigned long idx_start, | 1377 | int nfs_sync_inode(struct inode *inode, unsigned long idx_start, |
1378 | unsigned int npages, int how) | 1378 | unsigned int npages, int how) |
1379 | { | 1379 | { |
1380 | int error, | 1380 | int nocommit = how & FLUSH_NOCOMMIT; |
1381 | wait; | 1381 | int wait = how & FLUSH_WAIT; |
1382 | int error; | ||
1382 | 1383 | ||
1383 | wait = how & FLUSH_WAIT; | 1384 | how &= ~(FLUSH_WAIT|FLUSH_NOCOMMIT); |
1384 | how &= ~FLUSH_WAIT; | ||
1385 | 1385 | ||
1386 | do { | 1386 | do { |
1387 | error = 0; | 1387 | if (wait) { |
1388 | if (wait) | ||
1389 | error = nfs_wait_on_requests(inode, idx_start, npages); | 1388 | error = nfs_wait_on_requests(inode, idx_start, npages); |
1390 | if (error == 0) | 1389 | if (error != 0) |
1391 | error = nfs_flush_inode(inode, idx_start, npages, how); | 1390 | continue; |
1392 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 1391 | } |
1393 | if (error == 0) | 1392 | error = nfs_flush_inode(inode, idx_start, npages, how); |
1393 | if (error != 0) | ||
1394 | continue; | ||
1395 | if (!nocommit) | ||
1394 | error = nfs_commit_inode(inode, how); | 1396 | error = nfs_commit_inode(inode, how); |
1395 | #endif | ||
1396 | } while (error > 0); | 1397 | } while (error > 0); |
1397 | return error; | 1398 | return error; |
1398 | } | 1399 | } |