]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: Prevent a deadlock in the new writeback code
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 9 May 2012 18:30:35 +0000 (14:30 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 9 May 2012 19:16:07 +0000 (15:16 -0400)
commit6e9aea6f9db31072dd9994fd68be93a7e856732b
treead56aceafbcbd0650e71e029ffa138eedffd33ba
parent18a8facbc44fdecb33c63f5f899499df5998ff9d
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>
fs/nfs/pagelist.c
fs/nfs/write.c
include/linux/nfs_page.h