public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Prithvi Tambewagh <activprithvi@gmail.com>
Cc: martin.petersen@oracle.com, d.bogdanov@yadro.com,
	bvanassche@acm.org, linux-scsi@vger.kernel.org,
	target-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linux.dev, skhan@linuxfoundation.org,
	david.hunter.linux@gmail.com, khalid@kernel.org,
	syzbot+f6e8174215573a84b797@syzkaller.appspotmail.com,
	stable@vger.kernel.org
Subject: Re: [PATCH v3] scsi: target: fix recursive locking in __configfs_open_file()
Date: Thu, 5 Feb 2026 19:26:44 +0000	[thread overview]
Message-ID: <20260205192644.GT3183987@ZenIV> (raw)
In-Reply-To: <20260205162624.117957-1-activprithvi@gmail.com>

On Thu, Feb 05, 2026 at 09:56:24PM +0530, Prithvi Tambewagh wrote:

> +	r = kern_path(db_root_stage, LOOKUP_FOLLOW, &path);
> +	if (r) {
>  		pr_err("db_root: cannot open: %s\n", db_root_stage);
>  		goto unlock;
>  	}
> -	if (!S_ISDIR(file_inode(fp)->i_mode)) {
> -		filp_close(fp, NULL);
> +	if (!d_is_dir(path.dentry)) {
> +		path_put(&path);
>  		pr_err("db_root: not a directory: %s\n", db_root_stage);
> +		r = -ENOTDIR;
>  		goto unlock;
>  	}
> -	filp_close(fp, NULL);
> +	path_put(&path);

Just pass it LOOKUP_FOLLOW | LOOKUP_DIRECTORY and be done with the manual
"is it a directory" tests in any form...

  reply	other threads:[~2026-02-05 19:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05 16:26 [PATCH v3] scsi: target: fix recursive locking in __configfs_open_file() Prithvi Tambewagh
2026-02-05 19:26 ` Al Viro [this message]
2026-02-10 15:00   ` Prithvi
2026-02-16  5:54     ` Prithvi

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=20260205192644.GT3183987@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=activprithvi@gmail.com \
    --cc=bvanassche@acm.org \
    --cc=d.bogdanov@yadro.com \
    --cc=david.hunter.linux@gmail.com \
    --cc=khalid@kernel.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=skhan@linuxfoundation.org \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+f6e8174215573a84b797@syzkaller.appspotmail.com \
    --cc=target-devel@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox