From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: re: locks: don't allocate a lock context for an F_UNLCK request Date: Tue, 10 Mar 2015 23:10:50 +0300 Message-ID: <20150310201050.GA3870@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: jeff.layton@primarydata.com Return-path: Received: from aserp1040.oracle.com ([141.146.126.69]:20882 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751368AbbCJULD (ORCPT ); Tue, 10 Mar 2015 16:11:03 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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