]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: check for unmounted condition before printing debug output 23617/head
authorJeff Layton <jlayton@kernel.org>
Wed, 1 Aug 2018 13:05:51 +0000 (09:05 -0400)
committerPrashant D <pdhange@redhat.com>
Fri, 17 Aug 2018 00:39:35 +0000 (20:39 -0400)
If the filesystem was unmounted before we attempt to call ceph_ll_close
on a Fh, then we can end up tripping over the dereferences in the
debug output. Check for unmounted filesystem first, and only print
the debug info if it's still mounted.

This patch only fixes up ceph_ll_close, which is the only call ganesha
makes after calling ceph_abort_conn. We may need to fix other paths in
the future though if that ever changes.

Tracker: http://tracker.ceph.com/issues/25213
Signed-off-by: Jeff Layton <jlayton@kernel.org>
(cherry picked from commit 3c94f23d3b10928615a0f1381eb758006db84b13)

Conflicts:
src/client/Client.cc : Resolved in ll_release

src/client/Client.cc

index 7043f9058a405acc430f77774054f75da93cafb9..1322ade5908846962ff55c71216de64c8ddb3200 100644 (file)
@@ -13159,14 +13159,15 @@ int Client::fallocate(int fd, int mode, loff_t offset, loff_t length)
 int Client::ll_release(Fh *fh)
 {
   Mutex::Locker lock(client_lock);
+
+  if (unmounting)
+    return -ENOTCONN;
+
   ldout(cct, 3) << "ll_release (fh)" << fh << " " << fh->inode->ino << " " <<
     dendl;
   tout(cct) << "ll_release (fh)" << std::endl;
   tout(cct) << (unsigned long)fh << std::endl;
 
-  if (unmounting)
-    return -ENOTCONN;
-
   if (ll_unclosed_fh_set.count(fh))
     ll_unclosed_fh_set.erase(fh);
   return _release_fh(fh);