From: Ryusuke Konishi <ryusuke-sG5X7nlA6pw@public.gmane.org>
To: Jiro SEKIBA <jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
Cc: linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Ryusuke Konishi <ryusuke-sG5X7nlA6pw@public.gmane.org>
Subject: [PATCH 1/2] nilfs2_ss_manager: stop creating snapshot during shutdown
Date: Sun, 6 Feb 2011 19:14:14 +0900 [thread overview]
Message-ID: <1296987255-29949-1-git-send-email-ryusuke@osrg.net> (raw)
When the snapshot daemon shuts down by interrupt, it can failed to
unmount a part of snapshots since snapshot can be created during
shutdown the daemon.
This fixes the issue by disabling the snapshot creation when the
daemon goes to shutdown state.
Signed-off-by: Ryusuke Konishi <ryusuke-sG5X7nlA6pw@public.gmane.org>
---
nilfs2_ss_manager/nilfs2_ss_manager | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/nilfs2_ss_manager/nilfs2_ss_manager b/nilfs2_ss_manager/nilfs2_ss_manager
index 3056bcb..f19f6ba 100755
--- a/nilfs2_ss_manager/nilfs2_ss_manager
+++ b/nilfs2_ss_manager/nilfs2_ss_manager
@@ -52,6 +52,7 @@ class NILFSSSManager:
self.mp = mp
self.logger = logger
self.mounts = []
+ self.aborting = 0
def create_dir(self, path):
if os.path.exists(path):
@@ -71,6 +72,10 @@ class NILFSSSManager:
commands.getstatusoutput(cmd)
self.logger.out(syslog.LOG_INFO, "unmounted %s" % mp)
+ def shutdown(self):
+ self.aborting = 1
+ self.do_unmount_all()
+
def do_mount(self, cp, t='date'):
target = self.mp
if t == 'date':
@@ -88,9 +93,12 @@ class NILFSSSManager:
"mount ss = %d on %s" % (cp['cno'],target))
def create_ss(self):
+ if self.aborting: return
cps = self.ns.lscp()[:]
cps.reverse()
for cp in cps:
+ if self.aborting:
+ break
if cp['ss']:
break
self.logger.out(syslog.LOG_INFO,
@@ -122,7 +130,7 @@ class NODaemonContext:
def register_sighandlers(managers, mainloop):
def do_exit(a,b):
for m in managers:
- m.do_unmount_all()
+ m.shutdown()
mainloop.quit()
signal.signal(signal.SIGINT, do_exit)
signal.signal(signal.SIGTERM, do_exit)
--
1.7.2.3
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2011-02-06 10:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-06 10:14 Ryusuke Konishi [this message]
[not found] ` <1296987255-29949-1-git-send-email-ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-02-06 10:14 ` [PATCH 2/2] nilfs2_ss_manager: retry unmount for busy mount points Ryusuke Konishi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1296987255-29949-1-git-send-email-ryusuke@osrg.net \
--to=ryusuke-sg5x7nla6pw@public.gmane.org \
--cc=jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org \
--cc=linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).