diff --git a/HISTORY b/HISTORY index b0ed044b..e88e7fc7 100644 --- a/HISTORY +++ b/HISTORY @@ -12,6 +12,8 @@ SnapRAID HISTORY * Added a lock file to avoid multiple running instances on the same array. The file is named as parity file adding the .lock extension. There is also the undocumented --test-skip-lock to avoid to check it. + * Automatically ignores, with warning, mount points inside the array + directory tree. 3.1 2013/5 ========== diff --git a/TODO b/TODO index 4c591319..f6da7540 100644 --- a/TODO +++ b/TODO @@ -5,15 +5,6 @@ This is the list of TODO items for SnapRAID. - v3.2 - * Check the device of all the files and dirs in scan.c to avoid moint points. -} else if (S_ISDIR(st.st_mode)) { - if (st.st_dev!=disk->device) { - printf("Excluding mountpoint directory '%s'\n", path_next); - } else - if (filter_dir(&state->filterlist, disk->name, sub_next) == 0) { - ... - } - * Allow to specify the shared path to use to access remote symlink. * In the import list, uses also all the blocks in the array. diff --git a/scan.c b/scan.c index b650bcd7..6b59e846 100644 --- a/scan.c +++ b/scan.c @@ -664,18 +664,22 @@ static int scan_dir(struct snapraid_scan* scan, struct snapraid_state* state, in } } else if (S_ISDIR(st.st_mode)) { if (filter_dir(&state->filterlist, disk->name, sub_next) == 0) { - char sub_dir[PATH_MAX]; + if (st.st_dev != disk->device) { + fprintf(stderr, "warning: Ignoring mount point '%s'\n", path_next); + } else { + char sub_dir[PATH_MAX]; - /* recurse */ - pathslash(path_next, sizeof(path_next)); - pathcpy(sub_dir, sizeof(sub_dir), sub_next); - pathslash(sub_dir, sizeof(sub_dir)); - if (scan_dir(scan, state, output, disk, path_next, sub_dir) == 0) { - /* scan the directory as empty dir */ - scan_emptydir(scan, state, output, disk, sub_next); + /* recurse */ + pathslash(path_next, sizeof(path_next)); + pathcpy(sub_dir, sizeof(sub_dir), sub_next); + pathslash(sub_dir, sizeof(sub_dir)); + if (scan_dir(scan, state, output, disk, path_next, sub_dir) == 0) { + /* scan the directory as empty dir */ + scan_emptydir(scan, state, output, disk, sub_next); + } + /* or we processed something internally, or we have added the empty dir */ + processed = 1; } - /* or we processed something internally, or we have added the empty dir */ - processed = 1; } else { if (state->verbose) { printf("Excluding directory '%s'\n", path_next);