]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/9p/vfs_addr.c
Merge remote-tracking branch 'mkp-scsi/fixes' into fixes
[karo-tx-linux.git] / fs / 9p / vfs_addr.c
index 5ca1fb0043f6505c6958a16bc2c9688d7af6a291..adaf6f6dd858cb9b0a6b0077782d068b3d024e0b 100644 (file)
@@ -310,18 +310,10 @@ static int v9fs_write_end(struct file *filp, struct address_space *mapping,
 
        p9_debug(P9_DEBUG_VFS, "filp %p, mapping %p\n", filp, mapping);
 
-       if (unlikely(copied < len)) {
-               /*
-                * zero out the rest of the area
-                */
-               unsigned from = pos & (PAGE_SIZE - 1);
-
-               zero_user(page, from + copied, len - copied);
-               flush_dcache_page(page);
+       if (unlikely(copied < len && !PageUptodate(page))) {
+               copied = 0;
+               goto out;
        }
-
-       if (!PageUptodate(page))
-               SetPageUptodate(page);
        /*
         * No need to use i_size_read() here, the i_size
         * cannot change under us because we hold the i_mutex.
@@ -331,6 +323,7 @@ static int v9fs_write_end(struct file *filp, struct address_space *mapping,
                i_size_write(inode, last_pos);
        }
        set_page_dirty(page);
+out:
        unlock_page(page);
        put_page(page);