From nobody Sun Sep 7 14:54:18 2025 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 86257EB64DC for ; Thu, 20 Jul 2023 09:29:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230128AbjGTJ3f (ORCPT ); Thu, 20 Jul 2023 05:29:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230176AbjGTJ3P (ORCPT ); Thu, 20 Jul 2023 05:29:15 -0400 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F5B836F1E; Thu, 20 Jul 2023 02:15:11 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 36K9Eg3V023595; Thu, 20 Jul 2023 17:14:42 +0800 (+08) (envelope-from Yunlong.Xing@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4R66Rm74Y0z2K25JJ; Thu, 20 Jul 2023 17:13:24 +0800 (CST) Received: from tj10379pcu.spreadtrum.com (10.5.32.15) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 20 Jul 2023 17:14:40 +0800 From: Yunlong Xing To: , CC: , , , , Subject: [PATCH V3] ovl: fix mount fail because the upper doesn't have space Date: Thu, 20 Jul 2023 17:14:36 +0800 Message-ID: <20230720091436.399691-1-yunlong.xing@unisoc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.5.32.15] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 36K9Eg3V023595 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The current ovlfs mount flow: ovl_fill_super |_ovl_get_workdir |_ovl_make_workdir |_ovl_check_rename_whiteout In ovl_check_rename_whiteout(), a new file is attempted to create.But if the upper doesn't have space to do this, it will return error -ENOSPC, causing the mount fail. It means that if the upper is full, the overlayfs cannot be mounted. It is not reasonable, so this patch will omit this error and continue mount flow. Fixes: cad218ab3320 ("ovl: check if upper fs supports RENAME_WHITEOUT") Cc: stable@vger.kernel.org Signed-off-by: Yunlong Xing --- changes of v2: Following Amir's suggestion, assuming it is not supported if the check fails because the upper does't have space --- changes of v3: fix error of the '"' character in pr_warn() --- fs/overlayfs/super.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 5b069f1a1e44..486493711650 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -744,12 +744,13 @@ static int ovl_make_workdir(struct super_block *sb, s= truct ovl_fs *ofs, =20 /* Check if upper/work fs supports RENAME_WHITEOUT */ err =3D ovl_check_rename_whiteout(ofs); - if (err < 0) + if (err < 0 && err !=3D -ENOSPC) goto out; =20 - rename_whiteout =3D err; + rename_whiteout =3D err > 0; if (!rename_whiteout) - pr_warn("upper fs does not support RENAME_WHITEOUT.\n"); + pr_warn("upper fs does not support RENAME_WHITEOUT (%i).\n", + err); =20 /* * Check if upper/work fs supports (trusted|user).overlay.* xattr base-commit: eb26cbb1a754ccde5d4d74527dad5ba051808fad --=20 2.25.1