xfs: Remove dead code from inode recover function
PATCH 1/1 xfs: Remove dead code from inode recover function
The memcpy is guarded by a check which is performed a right before we call xfs_log_dinode_to_disk. At this point we are sure this check will always be false otherwise we would have errored out. So let's remove this dead weight.
Signed-off-by Nikolay Borisov <[email protected]>
--- fs/xfs/xfs_log_recover.c | 7 ------- 1 file changed, 7 deletions(-)
fs/xfs/xfs_log_recover.c +0 -7
@@ -3173,13 +3173,6 @@ xlog_recover_inode_pass2(/* recover the log dinode inode into the on disk inode */ xfs_log_dinode_to_disk (ldip, dip); -/* the rest is in on-disk format */ -if (item->ri_buf[1 ].i_len > isize) { -memcpy ((char *)dip + isize, - item->ri_buf[1 ].i_addr + isize, - item->ri_buf[1 ].i_len - isize); - } - fields = in_f->ilf_fields;if (fields &XFS_ILOG_DEV )xfs_dinode_put_rdev (dip, in_f->ilf_u.ilfu_rdev);
Signature · 1 line
2.7.4
Quoted 7 lines · Nikolay Borisov
The memcpy is guarded by a check which is performed a right before we call
xfs_log_dinode_to_disk. At this point we are sure this check will always be false otherwise we would have errored out. So let's remove this dead weight.Signed-off-by Nikolay Borisov <[email protected]>---
Looks good, memcpy will never be executed here, -EFSCORRUPTED will be returned if this condition is true right before this memcpy call.
Reviewed-by Carlos Maiolino <[email protected]>
Quoted 28 lines
fs/xfs/xfs_log_recover.c | 7 ------- 1 file changed, 7 deletions(-)fs/xfs/xfs_log_recover.c +0
-7@@ -3173,13 +3173,6 @@ xlog_recover_inode_pass2(/* recover the log dinode inode into the on disk inode */ xfs_log_dinode_to_disk (ldip, dip); -/* the rest is in on-disk format */ -if (item->ri_buf[1 ].i_len > isize) { -memcpy ((char *)dip + isize, - item->ri_buf[1 ].i_addr + isize, - item->ri_buf[1 ].i_len - isize); - } - fields = in_f->ilf_fields;if (fields &XFS_ILOG_DEV )xfs_dinode_put_rdev (dip, in_f->ilf_u.ilfu_rdev);Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Carlos