linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: jack@suse.cz
Cc: linux-fsdevel@vger.kernel.org
Subject: [bug report] fs: Restrict lock_two_nondirectories() to non-directory inodes
Date: Tue, 6 Jun 2023 11:32:53 +0300	[thread overview]
Message-ID: <ZH7vNQSIVurytnME@moroto> (raw)

Hello Jan Kara,

This is a semi-automatic email about new static checker warnings.

The patch afb4adc7c3ef: "fs: Restrict lock_two_nondirectories() to
non-directory inodes" from Jun 1, 2023, leads to the following Smatch
complaint:

    fs/inode.c:1174 unlock_two_nondirectories()
    warn: variable dereferenced before check 'inode1' (see line 1172)

    fs/inode.c:1176 unlock_two_nondirectories()
    warn: variable dereferenced before check 'inode2' (see line 1173)

fs/inode.c
  1171	{
  1172		WARN_ON_ONCE(S_ISDIR(inode1->i_mode));
                                     ^^^^^^^^^^^^^^
  1173		WARN_ON_ONCE(S_ISDIR(inode2->i_mode));
  1174		if (inode1)
                    ^^^^^^
  1175			inode_unlock(inode1);
  1176		if (inode2 && inode2 != inode1)
                    ^^^^^
regards,
dan carpenter

             reply	other threads:[~2023-06-06  8:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06  8:32 Dan Carpenter [this message]
2023-06-06  9:56 ` [bug report] fs: Restrict lock_two_nondirectories() to non-directory inodes Jan Kara
2023-06-07  7:23   ` Christian Brauner

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=ZH7vNQSIVurytnME@moroto \
    --to=dan.carpenter@linaro.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@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;
as well as URLs for NNTP newsgroup(s).