Skip to content

Commit 906369e

Browse files
Fred IsamanTrond Myklebust
authored andcommitted
NFS: fix directio refcount bug on commit
This reverts a hunk from commit 0427708 "NFS: Clean up - Simplify reference counting in fs/nfs/direct.c" The cleanups in that patch affect the write path, but by the time processing hits commit the removed reference has been added back by nfs_scan_commit_list(). Without this reversion, any page that is sent to commit holds on to an unbalanced reference that is never freed. The immediate effect is an imbalance over the wire between OPENs and CLOSEs. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent 2d0dbc6 commit 906369e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎fs/nfs/direct.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,9 @@ static void nfs_direct_commit_complete(struct nfs_commit_data *data)
517517
nfs_list_remove_request(req);
518518
if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) {
519519
/* Note the rewrite will go through mds */
520-
kref_get(&req->wb_kref);
521520
nfs_mark_request_commit(req, NULL, &cinfo);
522-
}
521+
} else
522+
nfs_release_request(req);
523523
nfs_unlock_and_release_request(req);
524524
}
525525

0 commit comments

Comments
 (0)