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 3ABF5C433EF for ; Thu, 7 Jul 2022 23:08:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236763AbiGGXIU (ORCPT ); Thu, 7 Jul 2022 19:08:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236533AbiGGXIT (ORCPT ); Thu, 7 Jul 2022 19:08:19 -0400 Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED37510FFB; Thu, 7 Jul 2022 16:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1657235299; x=1688771299; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=BZUSo8zL8IjB95QmzdXoVQEVWKVqu0Qf0g8IoUOX6Zg=; b=nCeRv3Va4kMi4yYfV2qYGMW63V9gN3V4G2eAppLuSu+jcXwor2c+X6KX kv6iAV3JQAYFQCwP9LUuE7DSX2smnRWvLrv9UYjm6uXxwr2pYVFioSViL lS5s4j2lb/76doq6Bwloau0Xc1UQmUCL11CuC0rpPH82ZuGnh6hoQYw/q o=; X-IronPort-AV: E=Sophos;i="5.92,253,1650931200"; d="scan'208";a="215935675" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1d-1c3c2014.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-2101.iad2.amazon.com with ESMTP; 07 Jul 2022 23:08:08 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-iad-1d-1c3c2014.us-east-1.amazon.com (Postfix) with ESMTPS id 90C96CAEB9; Thu, 7 Jul 2022 23:08:06 +0000 (UTC) Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Thu, 7 Jul 2022 23:08:05 +0000 Received: from 88665a182662.ant.amazon.com (10.43.162.50) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.9; Thu, 7 Jul 2022 23:08:02 +0000 From: Kuniyuki Iwashima To: , CC: Kuniyuki Iwashima , Ke Xu , "Ayushman Dutta" , Eric Sandeen , Paolo Bonzini , "Darrick J . Wong" Subject: [PATCH stable 4.9, 4.14, 4.19, 5.4, 5.10] xfs: remove incorrect ASSERT in xfs_rename Date: Thu, 7 Jul 2022 16:07:53 -0700 Message-ID: <20220707230753.32743-1-kuniyu@amazon.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.43.162.50] X-ClientProxiedBy: EX13D24UWB004.ant.amazon.com (10.43.161.4) To EX19D004ANA001.ant.amazon.com (10.37.240.138) Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eric Sandeen commit e445976537ad139162980bee015b7364e5b64fff upstream. Ayushman Dutta reported our 5.10 kernel hit the warning. It was because the original commit misses a Fixes tag and was not backported to the stable tree. The fix is merged in 5.16, but it conflicts in 4.9 - 5.10 because of the idmapped mount changes: ++<<<<<<< HEAD + ASSERT(!(flags & (RENAME_NOREPLACE | RENAME_EXCHANGE))); + error = xfs_rename_alloc_whiteout(target_dp, &wip); ++======= + error = xfs_rename_alloc_whiteout(mnt_userns, target_dp, &wip); ++>>>>>>> e445976537ad (xfs: remove incorrect ASSERT in xfs_rename) We can resolve this by removing mnt_userns from the argument. This ASSERT in xfs_rename is a) incorrect, because (RENAME_WHITEOUT|RENAME_NOREPLACE) is a valid combination, and b) unnecessary, because actual invalid flag combinations are already handled at the vfs level in do_renameat2() before we get called. So, remove it. Reported-by: Paolo Bonzini Signed-off-by: Eric Sandeen Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Fixes: 7dcf5c3e4527 ("xfs: add RENAME_WHITEOUT support") Signed-off-by: Kuniyuki Iwashima --- I confirmed this can be applied cleanly on the latest 4.9 - 5.10 stable branch, but if there is any problem, please let me know. --- fs/xfs/xfs_inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index e958b1c74561..03497741aef7 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3170,7 +3170,6 @@ xfs_rename( * appropriately. */ if (flags & RENAME_WHITEOUT) { - ASSERT(!(flags & (RENAME_NOREPLACE | RENAME_EXCHANGE))); error = xfs_rename_alloc_whiteout(target_dp, &wip); if (error) return error; -- 2.30.2