mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Zdb should be able to open the root dataset
If the pool/dataset command-line argument is specified with a trailing slash, for example, "tank/", it is interpreted as the root dataset. Signed-off-by: Tim Chase <tim@chase2k.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3415
This commit is contained in:
committed by
Brian Behlendorf
parent
79065ed5a4
commit
b1b85c8772
+11
-1
@@ -3572,6 +3572,7 @@ main(int argc, char **argv)
|
||||
int rewind = ZPOOL_NEVER_REWIND;
|
||||
char *spa_config_path_env;
|
||||
const char *opts = "bcdhilmMI:suCDRSAFLXevp:t:U:P";
|
||||
boolean_t target_is_spa = B_TRUE;
|
||||
|
||||
(void) setrlimit(RLIMIT_NOFILE, &rl);
|
||||
(void) enable_extended_FILE_stdio(-1, -1);
|
||||
@@ -3740,8 +3741,17 @@ main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (strpbrk(target, "/@") != NULL) {
|
||||
size_t targetlen;
|
||||
|
||||
target_is_spa = B_FALSE;
|
||||
targetlen = strlen(target);
|
||||
if (targetlen && target[targetlen - 1] == '/')
|
||||
target[targetlen - 1] = '\0';
|
||||
}
|
||||
|
||||
if (error == 0) {
|
||||
if (strpbrk(target, "/@") == NULL || dump_opt['R']) {
|
||||
if (target_is_spa || dump_opt['R']) {
|
||||
error = spa_open_rewind(target, &spa, FTAG, policy,
|
||||
NULL);
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user