]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: do not check_inode_max_size in eval() path
authorSage Weil <sage@newdream.net>
Mon, 13 Jul 2009 19:54:30 +0000 (12:54 -0700)
committerSage Weil <sage@newdream.net>
Tue, 14 Jul 2009 00:48:18 +0000 (17:48 -0700)
This is super dangerous, since we may journal something in the
middle of preparing another journal entry.  (This is notably a
problem with calls to issue_new_caps).

Kill fugly NO_SIZE_CHECK flag too, yay.

src/mds/CInode.h
src/mds/Locker.cc

index 1a9380e1d75dddfb29d7a0617995807e22aaef4f..5db6bcc6c2b13f28808dfc85aeb8a4af107811ea 100644 (file)
@@ -122,8 +122,7 @@ public:
   static const int STATE_EXPORTINGCAPS = (1<<10);
   static const int STATE_NEEDSRECOVER = (1<<11);
   static const int STATE_RECOVERING =   (1<<12);
-  static const int STATE_NO_SIZE_CHECK = (1<<13);
-  static const int STATE_PURGING =     (1<<14);
+  static const int STATE_PURGING =     (1<<13);
 
   // -- waiters --
   static const __u64 WAIT_DIR         = (1<<0);
index 1c30cfb4ac33415f82285b1c2384cb3e19be145f..02b9c9845a67f912a9b3f26c549c463cdcfc3570 100644 (file)
@@ -1126,15 +1126,6 @@ bool Locker::issue_caps(CInode *in, Capability *only_cap)
   // count conflicts with
   int nissued = 0;        
 
-  // should we increase client ranges?
-  if (in->is_file() &&
-      ((all_allowed|loner_allowed) & CEPH_CAP_FILE_WR) &&
-      in->is_auth() &&
-      !in->state_test(CInode::STATE_NO_SIZE_CHECK))
-    // we force an update here, which among other things avoids twiddling
-    // the lock state.
-    check_inode_max_size(in, true);
-
   // client caps
   map<int, Capability*>::iterator it;
   if (only_cap)
@@ -1833,7 +1824,6 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
     if (change_max &&
        !in->filelock.can_wrlock(client)) {
       dout(10) << " i want to change file_max, but lock won't allow it (yet)" << dendl;
-      in->state_set(CInode::STATE_NO_SIZE_CHECK);
       if (in->filelock.is_stable()) {
        bool need_issue = false;
        cap->inc_suppress();
@@ -1847,7 +1837,6 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
          issue_caps(in);
        cap->dec_suppress();
       }
-      in->state_clear(CInode::STATE_NO_SIZE_CHECK);
       if (!in->filelock.can_wrlock(client)) {
        in->filelock.add_waiter(SimpleLock::WAIT_STABLE, new C_MDL_CheckMaxSize(this, in));
        change_max = false;