From nobody Thu Apr 9 18:53:52 2026 Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 038F630EF88 for ; Fri, 6 Mar 2026 06:25:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772778330; cv=none; b=k8XNz8/6GQzP9Vg/bG3zhLC4J31tS+fPttmVAIfxmHRmiGk4OVKokdWNAOxmGTGNdXD64A7thaNmfr8Ghh3mFp59/2pSxN5X8M8CVKm1R63fSTcgSswELqtSNcXHVbqKEUOkYGQtiLqYmThP2Uj/jGAyU4LcMx7COZ6zTaGASWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772778330; c=relaxed/simple; bh=1udL0tstVkVgjICvNt9UFncofOdGR39IJz1DwlPiZ9o=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=ENaFLFqsPRyxnZQqIiRKQN0zDt/qkqbl0ehAG3ZEq41Ocg1P7gZ2mynfFMdhJWw3EkTBEuTKU7d6h3IOasJIxpNt56wZWDRtztfiSc/+V/YXD9+H52fFdePRcWPhtYPykakMqDIk4YbThmsr0Sh6h9C/+i+xAvniKYXVxoUS/eI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f71.google.com with SMTP id 006d021491bc7-679862e4413so135735378eaf.0 for ; Thu, 05 Mar 2026 22:25:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772778328; x=1773383128; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jjWz1P+D/JE9fmny5Ebpj+vxgbz3DV4TTyOkiZ9FTdg=; b=W7ut+PVUoRM2aV50qNvh/DZejVxrUPC8HN5bSjFFKGbjE8nigXzRWQmotrMaujpjPh aiUkFQJwULrepm/0IDANx9FadOZ6ggHe9uBFefic2P+Zex7CLg28b5Q3izBKbPs+EKQW sP+Rn9OQ2y/4s+xz5ZyYmmuMxeITmFPzn1FoflUgPmCEOhMOgXuI/1JSj9qdf+3yk4oT Q1IqVx/j5Dnz8pzu34rbqBTFN+evbwIhC4pSBEjECDuqcPTq2Twpd1xC6k03kUFPkw9U 1SoSELHZC6xMlK4vpP1jcH6tTYWy/z7NUzZLOOemFYkuBoCOiP3JVKCzIxsgaAQmzaq9 AWlg== X-Gm-Message-State: AOJu0YxypvsrhqFmYcC7cim+7HiBK8IuribRkpnsW2X0Pxb4JwYEowTK QXFUt0tklVauHs8S0gt438eVqF0rGZXCoYClXHFwhk6V67ww2egNecO4FHETz2N4seNi6O8kXE3 uMfFK5oH714+p/Cvo/T+o068ubhB3005jRfv4zpjcP8D9/Z/LrQ1Hpc9tMow= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:f02a:b0:67a:1d5c:b241 with SMTP id 006d021491bc7-67b9bd6d8abmr790438eaf.69.1772778328014; Thu, 05 Mar 2026 22:25:28 -0800 (PST) Date: Thu, 05 Mar 2026 22:25:27 -0800 In-Reply-To: <69a9251d.a70a0220.2f119.0003.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69aa7357.050a0220.13f275.000e.GAE@google.com> Subject: Forwarded: [PATCH] gfs2: add debug printk to trace existing entry in gfs2_create_inode From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] gfs2: add debug printk to trace existing entry in gfs2_cre= ate_inode Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master Add a debug printk when gfs2_dir_search finds an existing entry in gfs2_create_inode. This helps confirm whether the rwsem unlock WARNING in filename_symlinkat is caused by gfs2_create_inode returning false success (0) when file is NULL and an existing entry is found on a corrupted GFS2 image. The printk logs the directory inode, creation mode, file pointer, found inode, and rwsem owner at the point where the existing entry is detected. This is a temporary diagnostic patch and should be reverted once the root cause is confirmed. Reported-by: syzbot+2ed46b6b748df855347f@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D2ed46b6b748df855347f Signed-off-by: Deepanshu Kartikey --- fs/gfs2/inode.c | 3 +++ fs/namei.c | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 8344040ecaf7..e38dafea198c 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -738,6 +738,9 @@ static int gfs2_create_inode(struct inode *dir, struct = dentry *dentry, inode =3D gfs2_dir_search(dir, &dentry->d_name, !S_ISREG(mode) || excl); error =3D PTR_ERR(inode); if (!IS_ERR(inode)) { + pr_warn("DEBUG GFS2: gfs2_create_inode found existing entry! dir=3D%px m= ode=3D%o file=3D%px inode=3D%px S_ISDIR=3D%d rwsem owner=3D%px current=3D%p= x\n", + dir, mode, file, inode, S_ISDIR(inode->i_mode), + READ_ONCE(dir->i_rwsem.owner), current); if (S_ISDIR(inode->i_mode)) { iput(inode); inode =3D NULL; diff --git a/fs/namei.c b/fs/namei.c index 58f715f7657e..9584ff6dff47 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2944,6 +2944,11 @@ struct dentry *start_dirop(struct dentry *parent, st= ruct qstr *name, void end_dirop(struct dentry *de) { if (!IS_ERR(de)) { + struct inode *dir =3D d_inode(de->d_parent); + pr_warn("DEBUG: end_dirop: de=3D%px parent=3D%px inode=3D%px rwsem count= =3D%ld owner=3D%px current=3D%px\n", + de, de->d_parent, dir, + atomic_long_read(&dir->i_rwsem.count), + READ_ONCE(dir->i_rwsem.owner), current); inode_unlock(de->d_parent->d_inode); dput(de); } @@ -4922,7 +4927,9 @@ static struct dentry *filename_create(int dfd, struct= filename *name, dentry =3D start_dirop(path->dentry, &last, reval_flag | create_flags); if (IS_ERR(dentry)) goto out_drop_write; - + pr_warn("DEBUG: after start_dirop: dentry=3D%px parent=3D%px parent_inode= =3D%px rwsem owner=3D%px current=3D%px\n", + dentry, dentry->d_parent, d_inode(dentry->d_parent), + (void *)atomic_long_read(&d_inode(dentry->d_parent)->i_rwsem.count), cur= rent); if (unlikely(error)) goto fail; =20 @@ -4959,7 +4966,10 @@ EXPORT_SYMBOL(start_creating_path); */ void end_creating_path(const struct path *path, struct dentry *dentry) { - end_creating(dentry); + if (!IS_ERR(dentry)) { + inode_unlock(d_inode(path->dentry)); + dput(dentry); + } mnt_drop_write(path->mnt); path_put(path); } @@ -5639,6 +5649,10 @@ int filename_symlinkat(struct filename *from, int ne= wdfd, struct filename *to) if (!error) error =3D vfs_symlink(mnt_idmap(path.mnt), path.dentry->d_inode, dentry, from->name, &delegated_inode); + pr_warn("DEBUG: after vfs_symlink: error=3D%d dentry=3D%px parent=3D%px p= arent_inode=3D%px rwsem owner=3D%px path_dentry=3D%px path_inode=3D%px\n", + error, dentry, dentry->d_parent, d_inode(dentry->d_parent), + (void *)atomic_long_read(&d_inode(path.dentry)->i_rwsem.count), + path.dentry, d_inode(path.dentry)); end_creating_path(&path, dentry); if (is_delegated(&delegated_inode)) { error =3D break_deleg_wait(&delegated_inode); --=20 2.43.0