ext4: no need to add inode to orphan list during hole punch
authorAshish Sangwan <[email protected]>
Sun, 19 Aug 2012 02:29:46 +0000 (22:29 -0400)
committerTheodore Ts'o <[email protected]>
Sun, 19 Aug 2012 02:29:46 +0000 (22:29 -0400)
While performing punch hole for an inode, i_disksize is not changed.
So, there is no need to add the inode to orphan list.

Signed-off-by: Ashish Sangwan <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
Acked-by: Zheng Liu <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
fs/ext4/extents.c

index 2f082abf499244f2d860e1f9f9ec5efdf15eaa99..2e56903e8d532856afebc7ccc5f0dd011e7894b9 100644 (file)
@@ -4860,9 +4860,6 @@ int ext4_ext_punch_hole(struct file *file, loff_t offset, loff_t length)
        if (IS_ERR(handle))
                return PTR_ERR(handle);
 
-       err = ext4_orphan_add(handle, inode);
-       if (err)
-               goto out;
 
        /*
         * Now we need to zero out the non-page-aligned data in the
@@ -4948,7 +4945,6 @@ int ext4_ext_punch_hole(struct file *file, loff_t offset, loff_t length)
        up_write(&EXT4_I(inode)->i_data_sem);
 
 out:
-       ext4_orphan_del(handle, inode);
        inode->i_mtime = inode->i_ctime = ext4_current_time(inode);
        ext4_mark_inode_dirty(handle, inode);
        ext4_journal_stop(handle);