All of lore.kernel.org
 help / color / mirror / Atom feed
* re: ceph: move encode_fh to new API
@ 2012-04-18  9:40 Dan Carpenter
  2012-04-18 17:39 ` Sage Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2012-04-18  9:40 UTC (permalink / raw)
  To: sage; +Cc: ceph-devel

Hello Sage Weil,

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

The patch f59919a07e03: "ceph: move encode_fh to new API" from Apr 5, 
2012, leads to the following Smatch complaint:

fs/ceph/export.c:85 ceph_encode_fh()
	 error: we previously assumed 'dentry' could be null (see line 67)

fs/ceph/export.c
    66		/* if we found an alias, generate a connectable fh */
    67		if (*max_len >= connected_handle_length && dentry) {
                                                           ^^^^^^
New check.

    68			dout("encode_fh %p connectable\n", dentry);
    69			spin_lock(&dentry->d_lock);
    70			parent = dentry->d_parent;
    71			cfh->ino = ceph_ino(inode);
    72			cfh->parent_ino = ceph_ino(parent->d_inode);
    73			cfh->parent_name_hash = ceph_dentry_hash(parent->d_inode,
    74								 dentry);
    75			*max_len = connected_handle_length;
    76			type = 2;
    77			spin_unlock(&dentry->d_lock);
    78		} else if (*max_len >= handle_length) {
    79			if (parent_inode) {
    80				/* nfsd wants connectable */
    81				*max_len = connected_handle_length;
    82				type = 255;
    83			} else {
    84				dout("encode_fh %p\n", dentry);
    85				fh->ino = ceph_ino(dentry->d_inode);
                                                   ^^^^^^^^^^^^^^^
Old dereference.

    86				*max_len = handle_length;
    87				type = 1;

These emails really are mostly automated...  So if it's a false positive
then I blame the script.  Hope it's not too much spam.

regards,
dan carpenter


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

end of thread, other threads:[~2012-04-18 23:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-18  9:40 ceph: move encode_fh to new API Dan Carpenter
2012-04-18 17:39 ` Sage Weil
2012-04-18 23:02   ` Al Viro

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.