]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't rejournal files with caps that are unwanted
authorSage Weil <sage@newdream.net>
Fri, 13 Nov 2009 22:57:39 +0000 (14:57 -0800)
committerSage Weil <sage@newdream.net>
Fri, 13 Nov 2009 23:21:32 +0000 (15:21 -0800)
If they're unwanted, it's no biggie to fail to reconnect the cap.  And
Locker::adjust_cap_wanted() already adjusts the open_file logseg lists in
this way, so let's just totally consistent.

src/mds/journal.cc

index fe33f519a97776e1f71bd12f4ad21037f50d0752..6bb921a75cc73b501a221814d497a6f3633bf54c 100644 (file)
@@ -163,10 +163,16 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
       CInode *in = *p;
       ++p;
       if (in->is_any_caps()) {
-       dout(20) << "try_to_expire requeueing open file " << *in << dendl;
-       if (!le) le = new EOpen(mds->mdlog);
-       le->add_clean_inode(in);
-       ls->open_files.push_back(&in->xlist_open_file);
+       if (in->get_caps_wanted()) {
+         dout(20) << "try_to_expire requeueing open file " << *in << dendl;
+         if (!le) le = new EOpen(mds->mdlog);
+         le->add_clean_inode(in);
+         ls->open_files.push_back(&in->xlist_open_file);
+       } else {
+         // drop inodes that aren't wanted
+         dout(20) << "try_to_expire not requeueing and delisting unwanted file " << *in << dendl;
+         in->xlist_open_file.remove_myself();
+       }
       } else {
        /*
         * we can get a capless inode here if we replay an open file, the client fails to