From 07369305f81b5d1d2d5a66217d7109766a8a0887 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 13 Nov 2009 14:57:39 -0800 Subject: [PATCH] mds: don't rejournal files with caps that are unwanted 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 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mds/journal.cc b/src/mds/journal.cc index fe33f519a9777..6bb921a75cc73 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -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 -- 2.39.5