]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fs: semove set but not checked AOP_FLAG_UNINTERRUPTIBLE flag
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Mon, 8 May 2017 22:58:59 +0000 (15:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 May 2017 00:15:14 +0000 (17:15 -0700)
Commit afddba49d18f ("fs: introduce write_begin, write_end, and
perform_write aops") introduced AOP_FLAG_UNINTERRUPTIBLE flag which was
checked in pagecache_write_begin(), but that check was removed by
4e02ed4b4a2f ("fs: remove prepare_write/commit_write").

Between these two commits, commit d9414774dc0c ("cifs: Convert cifs to
new aops.") added a check in cifs_write_begin(), but that check was soon
removed by commit a98ee8c1c707 ("[CIFS] fix regression in
cifs_write_begin/cifs_write_end").

Therefore, AOP_FLAG_UNINTERRUPTIBLE flag is checked nowhere.  Let's
remove this flag.  This patch has no functionality changes.

Link: http://lkml.kernel.org/r/1489294781-53494-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Nick Piggin <npiggin@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Documentation/filesystems/vfs.txt
fs/buffer.c
fs/exofs/dir.c
fs/hfs/extent.c
fs/hfsplus/extents.c
fs/iomap.c
fs/namei.c
include/linux/fs.h
mm/filemap.c

index 94dd27ef4a766ca5414146fab1b76ea5aacb67de..f42b90687d406b73b4a24b2d92c9116540cc8ca1 100644 (file)
@@ -694,8 +694,7 @@ struct address_space_operations {
 
   write_end: After a successful write_begin, and data copy, write_end must
         be called. len is the original len passed to write_begin, and copied
-        is the amount that was able to be copied (copied == len is always true
-       if write_begin was called with the AOP_FLAG_UNINTERRUPTIBLE flag).
+        is the amount that was able to be copied.
 
         The filesystem must take care of unlocking the page and releasing it
         refcount, and updating i_size.
index 9196f2a270daac4d8d4612be27a0bd8288657335..c3c7455efa3f16547935d99edc5871644dba9992 100644 (file)
@@ -2379,8 +2379,7 @@ int generic_cont_expand_simple(struct inode *inode, loff_t size)
                goto out;
 
        err = pagecache_write_begin(NULL, mapping, size, 0,
-                               AOP_FLAG_UNINTERRUPTIBLE|AOP_FLAG_CONT_EXPAND,
-                               &page, &fsdata);
+                                   AOP_FLAG_CONT_EXPAND, &page, &fsdata);
        if (err)
                goto out;
 
@@ -2415,9 +2414,8 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
                }
                len = PAGE_SIZE - zerofrom;
 
-               err = pagecache_write_begin(file, mapping, curpos, len,
-                                               AOP_FLAG_UNINTERRUPTIBLE,
-                                               &page, &fsdata);
+               err = pagecache_write_begin(file, mapping, curpos, len, 0,
+                                           &page, &fsdata);
                if (err)
                        goto out;
                zero_user(page, zerofrom, len);
@@ -2449,9 +2447,8 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
                }
                len = offset - zerofrom;
 
-               err = pagecache_write_begin(file, mapping, curpos, len,
-                                               AOP_FLAG_UNINTERRUPTIBLE,
-                                               &page, &fsdata);
+               err = pagecache_write_begin(file, mapping, curpos, len, 0,
+                                           &page, &fsdata);
                if (err)
                        goto out;
                zero_user(page, zerofrom, len);
index 42f9a0a0c4caf09722bc69fa278d509a7b7f16b3..8eeb694332fe811e820ed342ebbecc25bb678a1f 100644 (file)
@@ -405,8 +405,7 @@ int exofs_set_link(struct inode *dir, struct exofs_dir_entry *de,
        int err;
 
        lock_page(page);
-       err = exofs_write_begin(NULL, page->mapping, pos, len,
-                               AOP_FLAG_UNINTERRUPTIBLE, &page, NULL);
+       err = exofs_write_begin(NULL, page->mapping, pos, len, 0, &page, NULL);
        if (err)
                EXOFS_ERR("exofs_set_link: exofs_write_begin FAILED => %d\n",
                          err);
index e33a0d36a93ebea7183909ff45f523302943b694..5d01826545809de7de454e2615553fc6a637ce70 100644 (file)
@@ -485,8 +485,8 @@ void hfs_file_truncate(struct inode *inode)
 
                /* XXX: Can use generic_cont_expand? */
                size = inode->i_size - 1;
-               res = pagecache_write_begin(NULL, mapping, size+1, 0,
-                               AOP_FLAG_UNINTERRUPTIBLE, &page, &fsdata);
+               res = pagecache_write_begin(NULL, mapping, size+1, 0, 0,
+                                           &page, &fsdata);
                if (!res) {
                        res = pagecache_write_end(NULL, mapping, size+1, 0, 0,
                                        page, fsdata);
index feca524ce2a5c7d6034bf0a528679fe923381507..a3eb640b4f8f8474130a893100303a0211d9037c 100644 (file)
@@ -545,9 +545,8 @@ void hfsplus_file_truncate(struct inode *inode)
                void *fsdata;
                loff_t size = inode->i_size;
 
-               res = pagecache_write_begin(NULL, mapping, size, 0,
-                                               AOP_FLAG_UNINTERRUPTIBLE,
-                                               &page, &fsdata);
+               res = pagecache_write_begin(NULL, mapping, size, 0, 0,
+                                           &page, &fsdata);
                if (res)
                        return;
                res = pagecache_write_end(NULL, mapping, size,
index 1faabe09b8fdb20f8dc355cc06ce452013ce64ec..4b10892967a5ae9a4ece5d8571e47c01c72f74da 100644 (file)
@@ -158,12 +158,6 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
        ssize_t written = 0;
        unsigned int flags = AOP_FLAG_NOFS;
 
-       /*
-        * Copies from kernel address space cannot fail (NFSD is a big user).
-        */
-       if (!iter_is_iovec(i))
-               flags |= AOP_FLAG_UNINTERRUPTIBLE;
-
        do {
                struct page *page;
                unsigned long offset;   /* Offset into pagecache page */
@@ -291,8 +285,7 @@ iomap_dirty_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
                        return PTR_ERR(rpage);
 
                status = iomap_write_begin(inode, pos, bytes,
-                               AOP_FLAG_NOFS | AOP_FLAG_UNINTERRUPTIBLE,
-                               &page, iomap);
+                                          AOP_FLAG_NOFS, &page, iomap);
                put_page(rpage);
                if (unlikely(status))
                        return status;
@@ -343,8 +336,8 @@ static int iomap_zero(struct inode *inode, loff_t pos, unsigned offset,
        struct page *page;
        int status;
 
-       status = iomap_write_begin(inode, pos, bytes,
-                       AOP_FLAG_UNINTERRUPTIBLE | AOP_FLAG_NOFS, &page, iomap);
+       status = iomap_write_begin(inode, pos, bytes, AOP_FLAG_NOFS, &page,
+                                  iomap);
        if (status)
                return status;
 
index 9a7f8bd748d817b29901e82943e06ae05811f73b..7286f87ce863568bbe1b84f8e432b809118146b5 100644 (file)
@@ -4766,7 +4766,7 @@ int __page_symlink(struct inode *inode, const char *symname, int len, int nofs)
        struct page *page;
        void *fsdata;
        int err;
-       unsigned int flags = AOP_FLAG_UNINTERRUPTIBLE;
+       unsigned int flags = 0;
        if (nofs)
                flags |= AOP_FLAG_NOFS;
 
index 5d62d2c47939a7d4d17ca5a76be91729c91f198c..249dad4e8d26be4179690cc47beaa61d3e1ff568 100644 (file)
@@ -250,9 +250,8 @@ enum positive_aop_returns {
        AOP_TRUNCATED_PAGE      = 0x80001,
 };
 
-#define AOP_FLAG_UNINTERRUPTIBLE       0x0001 /* will not do a short write */
-#define AOP_FLAG_CONT_EXPAND           0x0002 /* called from cont_expand */
-#define AOP_FLAG_NOFS                  0x0004 /* used by filesystem to direct
+#define AOP_FLAG_CONT_EXPAND           0x0001 /* called from cont_expand */
+#define AOP_FLAG_NOFS                  0x0002 /* used by filesystem to direct
                                                * helper code (eg buffer layer)
                                                * to clear GFP_FS from alloc */
 
index 681da61080bc35fe6a3cee9084f65fd7acd3ecdc..b7b973b47d8d9c498d9cafc83bfa2a21ea33e757 100644 (file)
@@ -2791,12 +2791,6 @@ ssize_t generic_perform_write(struct file *file,
        ssize_t written = 0;
        unsigned int flags = 0;
 
-       /*
-        * Copies from kernel address space cannot fail (NFSD is a big user).
-        */
-       if (!iter_is_iovec(i))
-               flags |= AOP_FLAG_UNINTERRUPTIBLE;
-
        do {
                struct page *page;
                unsigned long offset;   /* Offset into pagecache page */