Skip to contentSkip to conversation

Ext4: No need to add inode to orphan list during hole punch

PATCH RESEND Applied Ashish Sangwan 3 participants 3 messages Jul 25, 2012 – Aug 19, 2012 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 Ext4: No need to add inode to orphan list during hole punch

While performing punch hole for an inode, i_disksize is not changed. So, there is no need to add the inode to orphan list.

---
 fs/ext4/extents.c |    4 ----
 1 file changed, 4 deletions(-)
fs/ext4/extents.c +0 -4
index 91341ec..3e902f9 100644
@@ -4801,9 +4801,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
@@ -4889,7 +4886,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);
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Ashish Sangwan

While performing punch hole for an inode, i_disksize is not changed. So, there is no need to add the inode to orphan list.

Regards,
Zheng

Quoted 33 lines
---
 fs/ext4/extents.c |    4 ----
 1 file changed, 4 deletions(-)
fs/ext4/extents.c +0 -4
index 91341ec..3e902f9 100644
@@ -4801,9 +4801,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
@@ -4889,7 +4886,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);
Signature · 6 lines
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html