Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3042652lqt; Tue, 23 Apr 2024 08:53:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjCVx2Ldcu0GM0eAW9XwdIxZsmL8IJJ5OfHLEuC3DPDi2+gwYEHcmDJZc2UJ8FhbkuO1eh7wjU7fAyqAJ9ugWRDYvxcdO+VM68Md/wtg== X-Google-Smtp-Source: AGHT+IGaQaW7ULkqqVPSRRIX5JthECtA5hb1HhVNSwDG+pmjjaPVqcGdXmzoQ2fuyFRE0fkkRzi7 X-Received: by 2002:aa7:8888:0:b0:6ed:6056:c7c8 with SMTP id z8-20020aa78888000000b006ed6056c7c8mr20873540pfe.16.1713887592731; Tue, 23 Apr 2024 08:53:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713887592; cv=pass; d=google.com; s=arc-20160816; b=DpMA7s6IFv1X9DkFXOImbzvb4O5qZKWvOtVjtWw5XJswP61l/nYxEwi+LNliNEqw04 70myJHyg+OGAhQgItyK/Bs6QTxSn4MiTQL8ibibf3iO2LZyViMUfiT+cKxYsKv3q/Ns5 91h+Aqu8v4m43gkTXy3e/yN/rGUX5QBHJbeLe41SUfssNC11CTWYwSOWr2zf1Ru1RGuE wPWxgRRi9O71/9AMxpAIB2SDgrQUeJzC0KdTiX09nROVXKnjvq5qSZlzFhWecWjtV0GW btkn/aSxLE/22KzgwyiWTJ6q0FQn6L2NBkxFkvM0bdz39Z32xI+fxOufWHZF3lkIpTxf b2/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=DMimUcvNohsu8/S5/GBiRhv4MLCQ2GHo7sDNhJEiGnI=; fh=kNPPKl2GSzV4zwj3CLkLb70PknjkhE9yS3xUeu2O0+A=; b=RmITwOKZGITehKF5jwGU30pxDekMH4CZYHG0CK3sPcdv8swZE45PpDiojV9Xt1qesX sEvO7ul/R1alMjCAV5h8pFjS3dtuE/fGaWaUTiRk4NqSi+oILiD3o/+kVHH40AaQAC5K COj1HfOuUX+/54YMWsg4qvYVhojQSsfZzqThqNrqjWpGnkeaIwhM3g0FlsQawzIXpl/4 IIGjNYAxNUfFpREeOZioZ5K87Fmlx0dYf0iDwDlFE/YBtu+JIzuPphfjYNV/NNOmT06r S3mqjQHqfGvv8APd7S1QjEC/+J2Q+P405xarZQneh03fncBSv6VnWE5TC42KIqMuIuM1 mftA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="s/hUVOUk"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-155212-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155212-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s8-20020a056a0008c800b006ecfae875f7si10092570pfu.346.2024.04.23.08.53.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 08:53:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155212-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="s/hUVOUk"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-155212-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155212-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 458B828253C for ; Tue, 23 Apr 2024 12:49:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB33B136643; Tue, 23 Apr 2024 12:46:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="s/hUVOUk" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 852CB13541B; Tue, 23 Apr 2024 12:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713876383; cv=none; b=KDXCNTE5VI+Lt4se33bCeNgPEhxLl6xie+wv6181IrXdflaz/38f/LNdM4pzW8SGi4LR4J2Jvwnu0VS67feSPIlTAJanh4Frdhcihzdm/u9uI97e6CjJXaVmR6ETU6Hp3uy00ryARprFcyOt3ZMVOUI70JA40sfqC3iGJE69qxs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713876383; c=relaxed/simple; bh=WQNcgBK3/wz8IFQsAtME63HekOEmuN0zL+F7dVzOncM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B9CZfV1o2FpxoQwsp9VVb3WJCxtqcZWG/cM5ZRlMZ/ASHmfU7Pfhibm2AO/7tu/N93eVgSfdfdd+eGe7Xy4rv648PmpPQnxW1PFqj84zge8FDuF3fWh/zjBcQK0P6sTJoGGY6axPXBWX3JkEynYtGIJhC9sfCZL3G4UbOchyscA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=s/hUVOUk; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=DMimUcvNohsu8/S5/GBiRhv4MLCQ2GHo7sDNhJEiGnI=; b=s/hUVOUkeFsqpV3hLcFTvTXpKn fTC9hbU77vXKzIrOcHBVmQ4ERQUsPsku0UcXA/KNsCzIwZhVLRlSn+QoA5LolIRHUHVqWB9nfjbuG TJ6uDlNQBRPhZvDQ/M0LjwWjOa9UifGXnZi6StIUVplNnA+Y6OdUyEWF4+oI/SsPmVBVg/cShCsOa y6fJ2rxj/8ACNDO7d2I06Rnrqki6ITl0ZQqNGE/VM05YrtMhVpnM6FZvLcltuuuGYUPzgc/iXwgnp 9B6rJ+aNGKg/J92dRJ1VMnfXm5ttSMXNDMwFmES3qfqQz5VTXe1ORdlSF8Yd6pCDr/5ZyOcFFTnuW oxJj704Q==; Received: from [2001:4bb8:188:6493:c70:4a89:bc61:2] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzFXQ-0000000HUPv-1Smp; Tue, 23 Apr 2024 12:46:20 +0000 From: Christoph Hellwig To: Christian Brauner , Chandan Babu R , "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] xfs: don't call xfs_file_open from xfs_dir_open Date: Tue, 23 Apr 2024 14:46:08 +0200 Message-Id: <20240423124608.537794-4-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240423124608.537794-1-hch@lst.de> References: <20240423124608.537794-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Directories do not support direct I/O and thus no non-blocking direct I/O either. Open code the shutdown check and call to generic_file_open instead. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 4415d0f3bbc51b..2ce302b4885f53 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -1243,7 +1243,9 @@ xfs_dir_open( unsigned int mode; int error; - error = xfs_file_open(inode, file); + if (xfs_is_shutdown(ip->i_mount)) + return -EIO; + error = generic_file_open(inode, file); if (error) return error; -- 2.39.2