From nobody Sun Feb 8 05:28:11 2026 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 A1019C001DC for ; Wed, 19 Jul 2023 08:55:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229763AbjGSIzR (ORCPT ); Wed, 19 Jul 2023 04:55:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbjGSIzO (ORCPT ); Wed, 19 Jul 2023 04:55:14 -0400 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A2B41723; Wed, 19 Jul 2023 01:55:06 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 36J8sfkj002172; Wed, 19 Jul 2023 16:54:41 +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 4R5V3935qrz2K1r9W; Wed, 19 Jul 2023 16:53:25 +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; Wed, 19 Jul 2023 16:54:38 +0800 From: Yunlong Xing To: , CC: , , , , Subject: [PATCH V2] ovl: fix mount fail because the upper doesn't have space Date: Wed, 19 Jul 2023 16:54:34 +0800 Message-ID: <20230719085434.154834-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 36J8sfkj002172 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 Reviewed-by: Amir Goldstein --- changes of v2: Following Amir's suggestion, assuming it is not supported if the check fails because the upper does't have space --- 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..2b33c56fe4d7 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 --=20 2.25.1