linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] fs: Restrict lock_two_nondirectories() to non-directory inodes
@ 2023-06-06  8:32 Dan Carpenter
  2023-06-06  9:56 ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2023-06-06  8:32 UTC (permalink / raw)
  To: jack; +Cc: linux-fsdevel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-07  7:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-06  8:32 [bug report] fs: Restrict lock_two_nondirectories() to non-directory inodes Dan Carpenter
2023-06-06  9:56 ` Jan Kara
2023-06-07  7:23   ` Christian Brauner

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).