]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix null deref of cap in do_cap_update when doing intermediate snap updates
authorSage Weil <sage@newdream.net>
Tue, 24 Aug 2010 15:57:30 +0000 (08:57 -0700)
committerSage Weil <sage@newdream.net>
Tue, 24 Aug 2010 19:13:53 +0000 (12:13 -0700)
src/mds/Locker.cc

index 797f9fbb0834603331becbe10b3a7d3d31e6889e..c3182b68aab9b80318340728fc74124ac042fbf4 100644 (file)
@@ -2333,7 +2333,7 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
       ((dirty & CEPH_CAP_XATTR_EXCL) && !in->xattrlock.is_stable()) ||
       (!dirty && (!in->filelock.is_stable() || !in->authlock.is_stable() || !in->xattrlock.is_stable())) ||  // nothing dirty + unstable lock -> probably a revoke?
       (change_max && new_max) ||         // max INCREASE
-      (cap->wanted() & ~cap->pending()))
+      (cap && (cap->wanted() & ~cap->pending())))
     mds->mdlog->flush();
 
   return true;