From: Dan Carpenter <dan.carpenter@oracle.com>
To: jeff.layton@primarydata.com
Cc: linux-fsdevel@vger.kernel.org
Subject: re: locks: don't allocate a lock context for an F_UNLCK request
Date: Tue, 10 Mar 2015 23:10:50 +0300 [thread overview]
Message-ID: <20150310201050.GA3870@mwanda> (raw)
Hello Jeff Layton,
The patch 7af81f664280: "locks: don't allocate a lock context for an
F_UNLCK request" from Feb 26, 2015, leads to the following static
checker warning:
fs/locks.c:1613 generic_add_lease()
warn: comparison is always 'false'
fs/locks.c
1597 static int
1598 generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **priv)
1599 {
1600 struct file_lock *fl, *my_fl = NULL, *lease;
1601 struct dentry *dentry = filp->f_path.dentry;
1602 struct inode *inode = dentry->d_inode;
1603 struct file_lock_context *ctx;
1604 bool is_deleg = (*flp)->fl_flags & FL_DELEG;
1605 int error;
1606 LIST_HEAD(dispose);
1607
1608 lease = *flp;
1609 trace_generic_add_lease(inode, lease);
1610
1611 ctx = locks_get_lock_context(inode, arg);
1612 if (!ctx)
1613 return (arg == F_UNLCK) ? 0 : -ENOMEM;
^^^^^^^^^^^^^^
This will never be true. It's harmless, but I'm not sure it is
intentional.
1614
regards,
dan carpenter
next reply other threads:[~2015-03-10 20:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-10 20:10 Dan Carpenter [this message]
2015-03-10 20:13 ` locks: don't allocate a lock context for an F_UNLCK request Jeff Layton
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=20150310201050.GA3870@mwanda \
--to=dan.carpenter@oracle.com \
--cc=jeff.layton@primarydata.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.