]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - fs/ext4/inode.c
ext4: avoid hangs in ext4_da_should_update_i_disksize()
[~shefty/rdma-dev.git] / fs / ext4 / inode.c
index d2c86633811f997fec8ed00d7978e8e16f7f692a..b5edc6e4bab9810f7fa80a3dab6619795a29b114 100644 (file)
@@ -2508,7 +2508,7 @@ static int ext4_da_write_end(struct file *file,
         */
 
        new_i_size = pos + copied;
-       if (new_i_size > EXT4_I(inode)->i_disksize) {
+       if (copied && new_i_size > EXT4_I(inode)->i_disksize) {
                if (ext4_da_should_update_i_disksize(page, end)) {
                        down_write(&EXT4_I(inode)->i_data_sem);
                        if (new_i_size > EXT4_I(inode)->i_disksize) {