[sheepdog] [PATCH v2 1/3] md: create .stale for newly plugged disk
Liu Yuan
namei.unix at gmail.com
Wed Apr 17 12:55:00 CEST 2013
From: Liu Yuan <tailai.ly at taobao.com>
Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
sheep/md.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sheep/md.c b/sheep/md.c
index eaf7c4a..0bfadd0 100644
--- a/sheep/md.c
+++ b/sheep/md.c
@@ -254,12 +254,19 @@ out:
static uint64_t init_path_space(char *path)
{
uint64_t size;
+ char stale[PATH_MAX];
if (!is_xattr_enabled(path)) {
sd_iprintf("multi-disk support need xattr feature");
goto broken_path;
}
+ snprintf(stale, PATH_MAX, "%s/.stale", path);
+ if (xmkdir(stale, sd_def_dmode) < 0) {
+ sd_eprintf("can't mkdir for %s, %m", stale);
+ goto broken_path;
+ }
+
if (getxattr(path, MDNAME, &size, MDSIZE) < 0) {
if (errno == ENODATA) {
goto create;
--
1.7.9.5
More information about the sheepdog
mailing list