callers of iov_copy_from_user_atomic() don't need pagecache_disable()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 3 Feb 2014 03:10:25 +0000 (22:10 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 2 Apr 2014 03:19:20 +0000 (23:19 -0400)
... it does that itself (via kmap_atomic())

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/btrfs/file.c
fs/fuse/file.c
mm/filemap.c

index 0165b8672f099c49f96400fc0c87cc0b7cfc4532..34e096201da106ccb298dc9f13e11ceddd34524b 100644 (file)
@@ -425,13 +425,8 @@ static noinline int btrfs_copy_from_user(loff_t pos, int num_pages,
                struct page *page = prepared_pages[pg];
                /*
                 * Copy data from userspace to the current page
-                *
-                * Disable pagefault to avoid recursive lock since
-                * the pages are already locked
                 */
-               pagefault_disable();
                copied = iov_iter_copy_from_user_atomic(page, i, offset, count);
-               pagefault_enable();
 
                /* Flush processor's dcache for this page */
                flush_dcache_page(page);
index 77bcc303c3aeb9214ba4b13098da14fb8bcbe20b..a91d3b4d32f36c55aee5e860f89ea048f42acf6c 100644 (file)
@@ -1003,9 +1003,7 @@ static ssize_t fuse_fill_write_pages(struct fuse_req *req,
                if (mapping_writably_mapped(mapping))
                        flush_dcache_page(page);
 
-               pagefault_disable();
                tmp = iov_iter_copy_from_user_atomic(page, ii, offset, bytes);
-               pagefault_enable();
                flush_dcache_page(page);
 
                mark_page_accessed(page);
index 46e98019af6c6e38c3a8938601e80340fa08f815..bfb7a97d6d0f084bd81236a4b4960c556a82e6ad 100644 (file)
@@ -1974,7 +1974,6 @@ size_t iov_iter_copy_from_user_atomic(struct page *page,
        char *kaddr;
        size_t copied;
 
-       BUG_ON(!in_atomic());
        kaddr = kmap_atomic(page);
        if (likely(i->nr_segs == 1)) {
                int left;
@@ -2348,9 +2347,7 @@ again:
                if (mapping_writably_mapped(mapping))
                        flush_dcache_page(page);
 
-               pagefault_disable();
                copied = iov_iter_copy_from_user_atomic(page, i, offset, bytes);
-               pagefault_enable();
                flush_dcache_page(page);
 
                mark_page_accessed(page);