X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fzpl_file.c;h=db6a72c982fa9ed55202dfdd8260b915c32c63e2;hb=389cf730cedd42dd1ef653e9358635c114e458d5;hp=5ac41c9d24e9747a649e7e28e1a8bb5fb731e577;hpb=cb2d19010d8fbcf6c22585cd8763fad3ba7db724;p=zfs.git diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c index 5ac41c9..db6a72c 100644 --- a/module/zfs/zpl_file.c +++ b/module/zfs/zpl_file.c @@ -357,21 +357,16 @@ zpl_putpage(struct page *pp, struct writeback_control *wbc, void *data) ASSERT(PageLocked(pp)); ASSERT(!PageWriteback(pp)); + ASSERT(!(current->flags & PF_NOFS)); /* - * 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. + * Annotate this call path with a flag that indicates that it is + * unsafe to use KM_SLEEP during memory allocations due to the + * potential for a deadlock. KM_PUSHPAGE should be used instead. */ - if (current->flags & PF_MEMALLOC) { - (void) zfs_putpage(mapping->host, pp, wbc); - } else { - current->flags |= PF_MEMALLOC; - (void) zfs_putpage(mapping->host, pp, wbc); - current->flags &= ~PF_MEMALLOC; - } + current->flags |= PF_NOFS; + (void) zfs_putpage(mapping->host, pp, wbc); + current->flags &= ~PF_NOFS; return (0); } @@ -451,7 +446,6 @@ const struct file_operations zpl_file_operations = { .llseek = generic_file_llseek, .read = zpl_read, .write = zpl_write, - .readdir = zpl_readdir, .mmap = zpl_mmap, .fsync = zpl_fsync, #ifdef HAVE_FILE_FALLOCATE