Received: by 10.213.65.68 with SMTP id h4csp148255imn; Mon, 19 Mar 2018 23:05:22 -0700 (PDT) X-Google-Smtp-Source: AG47ELvj9ra7/pwoFtheQAtKCeTq9Fk6VrGZnhVZw3loimC98aF7avEcCBeSYS8C0V00SX7XfXNZ X-Received: by 10.99.123.80 with SMTP id k16mr11247506pgn.173.1521525922513; Mon, 19 Mar 2018 23:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521525922; cv=none; d=google.com; s=arc-20160816; b=0tXfYHkrwwEU1V/XIOAYzaW3+mooStHpPboj8+lem7Fw4JHhk499u/IzW4pMyuXlrx atWQVGm5hBkE1T5VXinqdSXdfQ9oOgihGFybBiUKXaUNE/q9sKIYacEA8a0vCtFWkzum anDV2Me6UA+ZC2RvjpIYtyYizzG/Z8VkW9ClXmKXw+LYq1GvSi/n5yMTflcBE+vSVnMR LppdWUwJ36vsipgANrJU/Ot3WewMrk+CwtQ52aNI7zBkRo7rmmLjJRxKCGnXe3D+/3zP 89nD4GIgEA8jVHw5PlqMIJHwZP5KeT94wmNHvZUnasVrDIaQKdD9LT+yPocbHW1bHqfe s/1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=3SpPAKb1KtO4oKk3XnB/a1uCTH0jUffgK0LLFbgP9aA=; b=w1of19CZFDlp3zZVrPt95RL2xgDAZgYAfn7pk9BBO/c5H6Ft6K1vD8HqWz1iqTaGTe WiQQtz3NvPgdhczGFhVHJrBcOHDwtAmv04hVonLYvslhuuCzuZj6aCihxxMufTQqRpYJ NbeSsM1BUYdEj+wCEntqYodU7QUTq0HbVA5084vOrY7XH1Tg9ikRO1pVzJo/uMtTUsiI FQ+daykxZ9Bvs4xuCMVPIOmqSJhk1kH4BASwJE53lBWeOQF1ql+iQ/R5IvmpUJvl0YWH ne0GIJipJ26rVpD1PJP3pHuoBmDFxK4uJkXNhPQoqZwkI67KNzKR5BsM2Tk0fUeXq+VS yElw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alibaba-inc.com header.s=default header.b=sCHkqjfm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba-inc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e16si681909pgq.596.2018.03.19.23.05.07; Mon, 19 Mar 2018 23:05:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@alibaba-inc.com header.s=default header.b=sCHkqjfm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alibaba-inc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751541AbeCTGEF (ORCPT + 99 others); Tue, 20 Mar 2018 02:04:05 -0400 Received: from out0-142.mail.aliyun.com ([140.205.0.142]:39534 "EHLO out0-142.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750828AbeCTGED (ORCPT ); Tue, 20 Mar 2018 02:04:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alibaba-inc.com; s=default; t=1521525833; h=From:To:Subject:Date:Message-Id; bh=3SpPAKb1KtO4oKk3XnB/a1uCTH0jUffgK0LLFbgP9aA=; b=sCHkqjfmu+HCezZX5341Hg6jKVA/ElpoTaB2WJ4AHtCV3iuPXNkjCKa6R6XqS+UoSllNhNrVYbKm6EuRkdS6Mt6jJbRWX5ctZMv0wQn5ET4xB8i/uleO/OPk9PNp7+MVFbD4OLs/i1OE0loSKiKjxOzu9jphjNZKYD2M/jH5QkI= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R281e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01l07447;MF=yuanliang.wyl@alibaba-inc.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---.BN9M84P_1521525832; Received: from localhost(mailfrom:yuanliang.wyl@alibaba-inc.com fp:42.120.165.210) by smtp.aliyun-inc.com(127.0.0.1); Tue, 20 Mar 2018 14:03:52 +0800 From: "=?UTF-8?B?546L5YWD6Imv?=" To: miklos@szeredi.hu Cc: , , "=?UTF-8?B?546L5YWD6Imv?=" Subject: [PATCH] fs/overlayfs: Drop dentry cache to prevent unknown file status Date: Tue, 20 Mar 2018 14:03:50 +0800 Message-Id: <1521525830-88382-1-git-send-email-yuanliang.wyl@alibaba-inc.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the dentry cache is not destroyed, statfs will take unknown status '?' Undestroyed cache dentry also caused new file creating fails Drop it using d_delete may be a choice [root@host /] Loaded plugins: bestyumcache, branch, fastestmirror, langpacks Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast Cleaning repos: xxx.base.x86_64 ops.x.noarch ops.x.x86_64 Cleaning up everything Cleaning up list of best yumcache Cleaning up list of fastest mirrors [root@host /] Loaded plugins: bestyumcache, branch, fastestmirror, langpacks Cleaning repos: xxx.base.x86_64 ops.x.noarch ops.x.x86_64 Cleaning up everything Cleaning up list of best yumcache Traceback (most recent call last): File "/usr/bin/yum", line 29, in yummain.user_main(sys.argv[1:], exit_code=True) File "/usr/share/yum-cli/yummain.py", line 365, in user_main errcode = main(args) File "/usr/share/yum-cli/yummain.py", line 174, in main result, resultmsgs = base.doCommands() File "/usr/share/yum-cli/cli.py", line 573, in doCommands return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds) File "/usr/share/yum-cli/yumcommands.py", line 1475, in doCommand return base.cleanCli(extcmds) File "/usr/share/yum-cli/cli.py", line 1666, in cleanCli self.plugins.run('clean') File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 188, in run func(conduitcls(self, self.base, conf, **kwargs)) File "/usr/lib/yum-plugins/branch.py", line 65, in clean_hook os.remove(os.path.join(root,filespath)) OSError: [Errno 2] No such file or directory: '/var/cache/yum/x86_64/x/xxxx.noarch.stable/ b49e49b87d17818d799363091c7a01dde83b421d-primary.sqlite.bz2' [root@host /] ls: cannot access /var/cache/yum/x86_64/x/xxxx.noarch.stable/ b49e49b87d17818d799363091c7a01dde83b421d-primary.sqlite.bz2: No such file or directory ls: cannot access /var/cache/yum/x86_64/x/xxxx.noarch.stable/cachecookie: No such file or directory ls: cannot access /var/cache/yum/x86_64/x/xxxx.noarch.stable/repomd.xml: No such file or directory total 0 ?????????? ? ? ? ? ? b49e49b87d17818d799363091c7a01dde83b421d-primary.sqlite.bz2 ?????????? ? ? ? ? ? cachecookie drwxr-xr-x 1 root root 30 Mar 15 16:12 gen drwxr-xr-x 2 root root 6 Jan 31 13:13 packages ?????????? ? ? ? ? ? repomd.xml Signed-off-by: Yuanliang Wang --- fs/overlayfs/super.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index e7c8ac4..f9343d3 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -380,9 +380,15 @@ static int ovl_dentry_weak_revalidate(struct dentry *dentry, unsigned int flags) return ret; } +static int ovl_dentry_delete(const struct dentry *dentry) +{ + return 1; +} + static const struct dentry_operations ovl_dentry_operations = { .d_release = ovl_dentry_release, .d_real = ovl_d_real, + .d_delete = ovl_dentry_delete, }; static const struct dentry_operations ovl_reval_dentry_operations = { -- 1.8.3.1