From 1545d03c5a47aa3e1724c886b55381acd1a6007d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 7 Dec 2011 21:05:40 -0800 Subject: [PATCH] client: unmount cleanup Signed-off-by: Sage Weil --- src/client/Client.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 568dcc451fc..0b2edb6e291 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -3292,18 +3292,12 @@ void Client::unmount() put_inode(cwd); cwd = NULL; - // NOTE: i'm assuming all caches are already flushing (because all files are closed). - // clean up any unclosed files - if (!fd_map.empty()) - ldout(cct, 0) << "Warning: Some files were not closed prior to unmounting; closing them now" << dendl; while (!fd_map.empty()) { - int fd = fd_map.begin()->first; - assert(fd_map.count(fd)); - Fh *fh = fd_map[fd]; + Fh *fh = fd_map.begin()->second; + fd_map.erase(fd_map.begin()); ldout(cct, 0) << " destroying lost open file " << fh << " on " << *fh->inode << dendl; _release_fh(fh); - fd_map.erase(fd); } _ll_drop_pins();