@@ -14,6 +14,7 @@
#include <linux/writeback.h>
#include <linux/swap.h>
#include <linux/migrate.h>
+#include <linux/sched.h>
#include <linux/sunrpc/clnt.h>
#include <linux/nfs_fs.h>
@@ -633,9 +634,14 @@ static int nfs_writepage_locked(struct page *page, struct writeback_control *wbc
int nfs_writepage(struct page *page, struct writeback_control *wbc)
{
- int ret;
+ int ret = 0;
+ if (unlikely(current->flags & PF_FSTRANS)) {
+ redirty_page_for_writepage(wbc, page);
+ goto unlock;
+ }
ret = nfs_writepage_locked(page, wbc);
+unlock:
unlock_page(page);
return ret;
}
The same rpciod codepaths that can trigger GFP_KERNEL allocations are still able to initiate writeback of NFS pages. Avoid this by adding an explicit test for PF_FSTRANS in nfs_writepage(). Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> --- fs/nfs/write.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)