Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6546127rwp; Tue, 18 Jul 2023 01:59:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlGO+Trf0CxfcFS/MzwZyIJLhwl440vi5eJ8b358lVJno539bagr4+HkKaDEmllOsHydeGwo X-Received: by 2002:a05:6358:5e16:b0:134:e952:16a8 with SMTP id q22-20020a0563585e1600b00134e95216a8mr9986645rwn.24.1689670780021; Tue, 18 Jul 2023 01:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689670779; cv=none; d=google.com; s=arc-20160816; b=D/Ot81VRbXiHQc/5yOnGrXr2jWcOOUZqHxwnhT3rGzNg/7ar0s/iOQ4YT/ECeffJwx CebSavSQXBf8/PHInsdcEJVdUpL10Bc3BKX8p0Gxsy2woakqkfF2kaOqSwHjOZeIRQLb rXIbUh9nuwxpC/5fiAi/ZWLccGvZc6fnvN17XDq1jTo1V1/2CPQ6I6JJMVMVtXRMYBgq AtWj3rZGXcnhlVhJGpY9IPUfRRrLUoQI0+E5Ssk5Q+8OsWG+za9F1vWw64WYio4X90Fc QSiT6qiNv4b+AurFbA5neJmeXakZxXJ/RkL67wbYgSM6IIRhj8lLJ3IBYc089/E3xFKg Pr3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=l8A2sw0woVrmXnaUjCsxfSchKBytRZeiCCnoUYv/Bzo=; fh=3yDqAe1jimsn5s79AeSo8VGlvIgKzfZON+wnaO+8VBk=; b=B3vAJGfFSzB2ctmSU/NzBUqxq2mjV/EJU0q3QdCVBGzXNbOuECbUDINCvaS0QMKl/K c2Wgf6+dejwKow5NcUj+bczQme3VeugTmNcENLq/R9OTw9tFfe2xX1twu4A0fMIcl4c9 mnVZqrpsrWHMva1Olq5wJBBGsoteHC5CBHI4K+W2pGoUZHdSfjgWebFSbJNlYmkxXCqv Eteqvy+awCXUZTfDllvGqB9VSyLGUAnFQ5MnKAkXqKzS3lVywn/XW98WBpfu691hvVQD XC3QxkfLWUcy55bfxUX5txmsnMpELhBqjdcrlW/1Ns8XqlkuUyXTge+zGTlfO/7Wue5k UQkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a655b89000000b0053fee209655si1211896pgr.664.2023.07.18.01.59.27; Tue, 18 Jul 2023 01:59:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231766AbjGRIgP (ORCPT + 99 others); Tue, 18 Jul 2023 04:36:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbjGRIgO (ORCPT ); Tue, 18 Jul 2023 04:36:14 -0400 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E0DEE55; Tue, 18 Jul 2023 01:36:10 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 36I8ZMII040720; Tue, 18 Jul 2023 16:35:22 +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 4R4sgP0vzwz2MhGBT; Tue, 18 Jul 2023 16:34:09 +0800 (CST) Received: from bj08434pcu.spreadtrum.com (10.0.73.87) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 18 Jul 2023 16:35:20 +0800 From: Yunlong Xing To: , CC: , , , , , , , Subject: [PATCH] ovl: fix mount fail because the upper doesn't have space Date: Tue, 18 Jul 2023 16:34:37 +0800 Message-ID: <1689669277-15291-1-git-send-email-yunlong.xing@unisoc.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.73.87] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 36I8ZMII040720 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") Signed-off-by: Yunlong Xing --- fs/overlayfs/super.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 5b069f1a1e44..2cf41e978cff 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -744,9 +744,12 @@ static int ovl_make_workdir(struct super_block *sb, struct ovl_fs *ofs, /* Check if upper/work fs supports RENAME_WHITEOUT */ err = ovl_check_rename_whiteout(ofs); - if (err < 0) - goto out; - + if (err < 0) { + if (err == -ENOSPC) + pr_warn("upper fs check RENAME_WHITEOUT fail due to no space.\n"); + else + goto out; + } rename_whiteout = err; if (!rename_whiteout) pr_warn("upper fs does not support RENAME_WHITEOUT.\n"); -- 2.25.1