diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-09 14:30:35 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-09 15:16:07 -0400 |
commit | 3aff4ebb95b20ad8db2c1447e8c52097d89af5a7 (patch) | |
tree | ad56aceafbcbd0650e71e029ffa138eedffd33ba /include/linux/nfs_page.h | |
parent | dc327ed4cd320be689596365372a3683208c3ba0 (diff) | |
download | blackbird-op-linux-3aff4ebb95b20ad8db2c1447e8c52097d89af5a7.tar.gz blackbird-op-linux-3aff4ebb95b20ad8db2c1447e8c52097d89af5a7.zip |
NFS: Prevent a deadlock in the new writeback code
We have to unlock the nfs_page before we call nfs_end_page_writeback
to avoid races with functions that expect the page to be unlocked
when PG_locked and PG_writeback are not set.
The problem is that nfs_unlock_request also releases the nfs_page,
causing a deadlock if the release of the nfs_open_context
triggers an iput() while the PG_writeback flag is still set...
The solution is to separate the unlocking and release of the nfs_page,
so that we can do the former before nfs_end_page_writeback and the
latter after.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Fred Isaman <iisaman@netapp.com>
Diffstat (limited to 'include/linux/nfs_page.h')
-rw-r--r-- | include/linux/nfs_page.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index f9ee9eba7f88..ef7504215446 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h @@ -96,6 +96,7 @@ extern bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc, struct nfs_page *req); extern int nfs_wait_on_request(struct nfs_page *); extern void nfs_unlock_request(struct nfs_page *req); +extern void nfs_unlock_request_dont_release(struct nfs_page *req); /* * Lock the page of an asynchronous request without getting a new reference |