CEPH filesystem development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: sage@newdream.net
Cc: ceph-devel@vger.kernel.org
Subject: re: ceph: move encode_fh to new API
Date: Wed, 18 Apr 2012 12:40:28 +0300	[thread overview]
Message-ID: <20120418094028.GA6866@elgon.mountain> (raw)

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


             reply	other threads:[~2012-04-18  9:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18  9:40 Dan Carpenter [this message]
2012-04-18 17:39 ` ceph: move encode_fh to new API Sage Weil
2012-04-18 23:02   ` Al Viro

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=20120418094028.GA6866@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sage@newdream.net \
    /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