]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: Fix coverity 716909 [FORWARD_NULL]
authorSam Lang <sam.lang@inktank.com>
Wed, 26 Sep 2012 02:11:45 +0000 (19:11 -0700)
committerSage Weil <sage@inktank.com>
Wed, 26 Sep 2012 23:44:47 +0000 (16:44 -0700)
If we fill the request path from the dentry instead of the inode, we
need to use the dentry inode.  This fixes a segfault that would occur
in the case where request->inode is in fact null.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
src/client/Client.cc

index 7f4def01b4a937ba5553ddf2c8f4cb9a187af792..67ababa81891332fe036646b6993d95857b494bb 100644 (file)
@@ -1328,7 +1328,7 @@ MClientRequest* Client::build_client_request(MetaRequest *request)
       request->inode->make_nosnap_relative_path(request->path);
     else if (request->dentry) {
       if (request->dentry->inode)
-       request->inode->make_nosnap_relative_path(request->path);
+       request->dentry->inode->make_nosnap_relative_path(request->path);
       else if (request->dentry->dir) {
        request->dentry->dir->parent_inode->make_nosnap_relative_path(request->path);
        request->path.push_dentry(request->dentry->name);