From patchwork Tue Feb 20 13:53:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 10230127 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BA4AF602DC for ; Tue, 20 Feb 2018 13:53:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAECF28695 for ; Tue, 20 Feb 2018 13:53:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F55628699; Tue, 20 Feb 2018 13:53:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E09A28695 for ; Tue, 20 Feb 2018 13:53:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750733AbeBTNxI (ORCPT ); Tue, 20 Feb 2018 08:53:08 -0500 Received: from mx2.suse.de ([195.135.220.15]:46269 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732AbeBTNxI (ORCPT ); Tue, 20 Feb 2018 08:53:08 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DB002ADE6 for ; Tue, 20 Feb 2018 13:53:06 +0000 (UTC) From: Nikolay Borisov To: linux-xfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH] xfs: Remove duplicated check Date: Tue, 20 Feb 2018 15:53:02 +0200 Message-Id: <1519134782-10062-1-git-send-email-nborisov@suse.com> X-Mailer: git-send-email 2.7.4 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The check performed before the memcpy responsible for copying the rest of the inode is already performed before we call xfs_log_dinode_to_disk. So let's remove the 2nd instance of the check. No functional changes. Signed-off-by: Nikolay Borisov Reported-by: Jeff Mahoney Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_log_recover.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 00240c9ee72e..88dccfb1de96 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -3174,11 +3174,8 @@ xlog_recover_inode_pass2( 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, + 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)