Re: [PATCH] xfs: Remove dead code from inode recover function
From: Carlos Maiolino <hidden>
Date: 2018-02-21 11:55:30
On Wed, Feb 21, 2018 at 09:22:24AM +0200, Nikolay Borisov wrote:
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 <redacted> ---
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 <redacted>
quoted hunk ↗ jump to hunk
fs/xfs/xfs_log_recover.c | 7 ------- 1 file changed, 7 deletions(-)diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 00240c9ee72e..cb20f2e83412 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c@@ -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);-- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
-- Carlos