mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Ignores mount points.
This commit is contained in:
parent
de25273d1a
commit
6a23acec2f
3 changed files with 16 additions and 19 deletions
2
HISTORY
2
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
|
||||
==========
|
||||
|
|
|
|||
9
TODO
9
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.
|
||||
|
|
|
|||
24
scan.c
24
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue