Re: cmds segfault on pdj-fstest (ceph.git unstable)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
>    add checks for being a snapshot root to dir_is_nonempty
>
> :040000 040000 6c45c68b84800b105299133374f0f91d82948659 2c1b290125ae435679ab29d6fbab7f5b8f81e4b9 M      src
>

I also got this segfault today. The segfault is caused by:
_dir_is_nonempty() has already done reply_request(), but the caller,
handle_client_unlink(), did it again.

I suggest to move out reply_request() from _dir_is_nonempty(), and
leave it to the caller.
Maybe as below:

Henry


===========================================
diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index 29d0a32..4a90f4e 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -3976,7 +3976,6 @@ bool Server::_dir_is_nonempty(MDRequest *mdr, CInode *in)
               << dir->inode->get_projected_inode()->dirstat.size()
               << " on " << *dir->inode
               << dendl;
-      reply_request(mdr, -ENOTEMPTY);
       return true;
     }

@@ -4070,8 +4069,10 @@ void Server::handle_client_rename(MDRequest *mdr)
     }

     // non-empty dir?
-    if (oldin->is_dir() && _dir_is_nonempty(mdr, oldin))
+    if (oldin->is_dir() && _dir_is_nonempty(mdr, oldin)) {
+      reply_request(mdr, -ENOTEMPTY);
       return;
+    }
   }

   // -- some sanity checks --
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux