From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44FD1C7EE21 for ; Tue, 18 Apr 2023 12:31:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231601AbjDRMb6 (ORCPT ); Tue, 18 Apr 2023 08:31:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231599AbjDRMbw (ORCPT ); Tue, 18 Apr 2023 08:31:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 317DDB758 for ; Tue, 18 Apr 2023 05:31:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 331BF6320F for ; Tue, 18 Apr 2023 12:31:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46D8FC433EF; Tue, 18 Apr 2023 12:31:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1681821082; bh=FSdzolV37+Y0e9VsLAP/fpZtjwozTZYnOfENyNnrS0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KSrK9+Z2ZO3wc8uBFxPI/V+Dq1f1WnxS2uqg83x8YsAr86teV+jrZPKzwA9itiFhz jVS7uku/x1piKTr5PdF7iqtWjRDKXIhbMKz8+gi5NTHZyRAgLyGuHKtlqVbf7qZ1De izD0sGs59h55WfqG1ArMlefbyW92mfv06MniOtVU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christoph Hellwig , Brian Foster , Chandan Rajendra , "Darrick J. Wong" , Chandan Babu R , "Darrick J. Wong" Subject: [PATCH 5.4 84/92] xfs: simplify a check in xfs_ioctl_setattr_check_cowextsize Date: Tue, 18 Apr 2023 14:21:59 +0200 Message-Id: <20230418120307.723060751@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230418120304.658273364@linuxfoundation.org> References: <20230418120304.658273364@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christoph Hellwig commit 5e28aafe708ba3e388f92a7148093319d3521c2f upstream. Only v5 file systems can have the reflink feature, and those will always use the large dinode format. Remove the extra check for the inode version. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Chandan Rajendra Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R Acked-by: Darrick J. Wong Signed-off-by: Greg Kroah-Hartman --- fs/xfs/xfs_ioctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1510,8 +1510,7 @@ xfs_ioctl_setattr_check_cowextsize( if (!(fa->fsx_xflags & FS_XFLAG_COWEXTSIZE)) return 0; - if (!xfs_sb_version_hasreflink(&ip->i_mount->m_sb) || - ip->i_d.di_version != 3) + if (!xfs_sb_version_hasreflink(&ip->i_mount->m_sb)) return -EINVAL; if (fa->fsx_cowextsize == 0)