X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fzpl_file.c;h=c2e3a6bdcf489811b03035a1fc7f39bb060967c2;hb=7f4afd300b753ee7e0ce1f8d12c098119193001b;hp=fc2b8132943405130286037dfd6bb18fda77471c;hpb=e2e7aa2df88708cdcae87688a69ba3f5d1cc43ed;p=zfs.git diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c index fc2b813..c2e3a6b 100644 --- a/module/zfs/zpl_file.c +++ b/module/zfs/zpl_file.c @@ -354,7 +354,16 @@ zpl_putpage(struct page *pp, struct writeback_control *wbc, void *data) { int error; + /* + * Disable the normal reclaim path for zpl_putpage(). This + * ensures that all memory allocations under this call path + * will never enter direct reclaim. If this were to happen + * the VM might try to write out additional pages by calling + * zpl_putpage() again resulting in a deadlock. + */ + current->flags |= PF_MEMALLOC; error = -zfs_putpage(pp, wbc, data); + current->flags &= ~PF_MEMALLOC; if (error) { SetPageError(pp);