diff options
Diffstat (limited to 'fs/nfs/write.c')
| -rw-r--r-- | fs/nfs/write.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index af0c6279a4a7..3bd5d7e80f6c 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
| @@ -542,11 +542,15 @@ nfs_scan_commit(struct inode *inode, struct list_head *dst, pgoff_t idx_start, u | |||
| 542 | if (!nfs_need_commit(nfsi)) | 542 | if (!nfs_need_commit(nfsi)) |
| 543 | return 0; | 543 | return 0; |
| 544 | 544 | ||
| 545 | spin_lock(&inode->i_lock); | ||
| 545 | ret = nfs_scan_list(nfsi, dst, idx_start, npages, NFS_PAGE_TAG_COMMIT); | 546 | ret = nfs_scan_list(nfsi, dst, idx_start, npages, NFS_PAGE_TAG_COMMIT); |
| 546 | if (ret > 0) | 547 | if (ret > 0) |
| 547 | nfsi->ncommit -= ret; | 548 | nfsi->ncommit -= ret; |
| 549 | spin_unlock(&inode->i_lock); | ||
| 550 | |||
| 548 | if (nfs_need_commit(NFS_I(inode))) | 551 | if (nfs_need_commit(NFS_I(inode))) |
| 549 | __mark_inode_dirty(inode, I_DIRTY_DATASYNC); | 552 | __mark_inode_dirty(inode, I_DIRTY_DATASYNC); |
| 553 | |||
| 550 | return ret; | 554 | return ret; |
| 551 | } | 555 | } |
| 552 | #else | 556 | #else |
| @@ -676,7 +680,6 @@ static int nfs_writepage_setup(struct nfs_open_context *ctx, struct page *page, | |||
| 676 | req = nfs_setup_write_request(ctx, page, offset, count); | 680 | req = nfs_setup_write_request(ctx, page, offset, count); |
| 677 | if (IS_ERR(req)) | 681 | if (IS_ERR(req)) |
| 678 | return PTR_ERR(req); | 682 | return PTR_ERR(req); |
| 679 | nfs_mark_request_dirty(req); | ||
| 680 | /* Update file length */ | 683 | /* Update file length */ |
| 681 | nfs_grow_file(page, offset, count); | 684 | nfs_grow_file(page, offset, count); |
| 682 | nfs_mark_uptodate(page, req->wb_pgbase, req->wb_bytes); | 685 | nfs_mark_uptodate(page, req->wb_pgbase, req->wb_bytes); |
| @@ -1414,8 +1417,7 @@ static void nfs_commit_done(struct rpc_task *task, void *calldata) | |||
| 1414 | task->tk_pid, task->tk_status); | 1417 | task->tk_pid, task->tk_status); |
| 1415 | 1418 | ||
| 1416 | /* Call the NFS version-specific code */ | 1419 | /* Call the NFS version-specific code */ |
| 1417 | if (NFS_PROTO(data->inode)->commit_done(task, data) != 0) | 1420 | NFS_PROTO(data->inode)->commit_done(task, data); |
| 1418 | return; | ||
| 1419 | } | 1421 | } |
| 1420 | 1422 | ||
| 1421 | void nfs_commit_release_pages(struct nfs_write_data *data) | 1423 | void nfs_commit_release_pages(struct nfs_write_data *data) |
| @@ -1483,9 +1485,7 @@ int nfs_commit_inode(struct inode *inode, int how) | |||
| 1483 | res = nfs_commit_set_lock(NFS_I(inode), may_wait); | 1485 | res = nfs_commit_set_lock(NFS_I(inode), may_wait); |
| 1484 | if (res <= 0) | 1486 | if (res <= 0) |
| 1485 | goto out_mark_dirty; | 1487 | goto out_mark_dirty; |
| 1486 | spin_lock(&inode->i_lock); | ||
| 1487 | res = nfs_scan_commit(inode, &head, 0, 0); | 1488 | res = nfs_scan_commit(inode, &head, 0, 0); |
| 1488 | spin_unlock(&inode->i_lock); | ||
| 1489 | if (res) { | 1489 | if (res) { |
| 1490 | int error; | 1490 | int error; |
| 1491 | 1491 | ||
