linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: syzbot <syzbot+75eab84fd0af9e8bf66b@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org,
	overlayfs <linux-unionfs@vger.kernel.org>,
	syzkaller-bugs <syzkaller-bugs@googlegroups.com>
Subject: Re: [syzbot] WARNING in ovl_create_real
Date: Tue, 7 Sep 2021 16:03:49 +0200	[thread overview]
Message-ID: <CAJfpegvOa5cT5eRTsaMtAJ0YfZ1ob_kuW-NNK-emu3ncp2pK7A@mail.gmail.com> (raw)
In-Reply-To: <0000000000006dd93205cad885e5@google.com>

[-- Attachment #1: Type: text/plain, Size: 82 bytes --]

#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
master

[-- Attachment #2: ovl-test.patch --]
[-- Type: text/x-patch, Size: 920 bytes --]

diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
index 1fefb2b8960e..0f6c10ec56c1 100644
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -150,6 +150,9 @@ static int ovl_mkdir_real(struct inode *dir, struct dentry **newdentry,
 	if (likely(!d_unhashed(dentry)))
 		return 0;
 
+	pr_info("unhashed dentry after mkdir (%s)\n",
+		dentry->d_sb->s_type->name);
+
 	/*
 	 * vfs_mkdir() may succeed and leave the dentry passed
 	 * to it unhashed and negative. If that happens, try to
@@ -209,7 +212,10 @@ struct dentry *ovl_create_real(struct inode *dir, struct dentry *newdentry,
 			err = -EPERM;
 		}
 	}
-	if (!err && WARN_ON(!newdentry->d_inode)) {
+	if (!err && !newdentry->d_inode) {
+		pr_warn("negative dentry after mkdir (%s)\n",
+			newdentry->d_sb->s_type->name);
+		WARN_ON(1);
 		/*
 		 * Not quite sure if non-instantiated dentry is legal or not.
 		 * VFS doesn't seem to care so check and warn here.

  reply	other threads:[~2021-09-07 14:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 10:36 syzbot
2021-09-07 14:03 ` Miklos Szeredi [this message]
2021-09-07 15:15   ` syzbot
2021-09-08  8:05   ` Miklos Szeredi
2021-09-08  8:26     ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJfpegvOa5cT5eRTsaMtAJ0YfZ1ob_kuW-NNK-emu3ncp2pK7A@mail.gmail.com \
    --to=miklos@szeredi.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=syzbot+75eab84fd0af9e8bf66b@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --subject='Re: [syzbot] WARNING in ovl_create_real' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).