git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Retry removal of busy minors
[zfs.git]
/
lib
/
libzfs
/
libzfs_pool.c
diff --git
a/lib/libzfs/libzfs_pool.c
b/lib/libzfs/libzfs_pool.c
index
9213101
..
7b78f25
100644
(file)
--- a/
lib/libzfs/libzfs_pool.c
+++ b/
lib/libzfs/libzfs_pool.c
@@
-443,7
+443,7
@@
zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
goto error;
}
goto error;
}
- if (intval != 0 && (intval < 9 || intval > 1
2
)) {
+ if (intval != 0 && (intval < 9 || intval > 1
3
)) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"property '%s' number %d is invalid."),
propname, intval);
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"property '%s' number %d is invalid."),
propname, intval);
@@
-490,6
+490,7
@@
zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
verify(nvlist_lookup_nvlist(zpool_get_config(zhp, NULL),
ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0);
verify(nvlist_lookup_nvlist(zpool_get_config(zhp, NULL),
ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0);
+#if defined(__sun__) || defined(__sun)
/*
* bootfs property cannot be set on a disk which has
* been EFI labeled.
/*
* bootfs property cannot be set on a disk which has
* been EFI labeled.
@@
-502,6
+503,7
@@
zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
zpool_close(zhp);
goto error;
}
zpool_close(zhp);
goto error;
}
+#endif
zpool_close(zhp);
break;
zpool_close(zhp);
break;
@@
-670,10
+672,12
@@
zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp)
* Don't start the slice at the default block of 34; many storage
* devices will use a stripe width of 128k, other vendors prefer a 1m
* alignment. It is best to play it safe and ensure a 1m alignment
* Don't start the slice at the default block of 34; many storage
* devices will use a stripe width of 128k, other vendors prefer a 1m
* alignment. It is best to play it safe and ensure a 1m alignment
- * give 512b blocks. When the block size is larger by a power of 2
- * we will still be 1m aligned.
+ * given 512B blocks. When the block size is larger by a power of 2
+ * we will still be 1m aligned. Some devices are sensitive to the
+ * partition ending alignment as well.
*/
*/
-#define NEW_START_BLOCK 2048
+#define NEW_START_BLOCK 2048
+#define PARTITION_END_ALIGNMENT 2048
/*
* Validate the given pool name, optionally putting an extended error message in
/*
* Validate the given pool name, optionally putting an extended error message in
@@
-1581,6
+1585,12
@@
zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
(void) zpool_standard_error(hdl, error, desc);
break;
(void) zpool_standard_error(hdl, error, desc);
break;
+ case EBUSY:
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "one or more devices are already in use\n"));
+ (void) zfs_error(hdl, EZFS_BADDEV, desc);
+ break;
+
default:
(void) zpool_standard_error(hdl, error, desc);
zpool_explain_recover(hdl,
default:
(void) zpool_standard_error(hdl, error, desc);
zpool_explain_recover(hdl,
@@
-2078,7
+2088,7
@@
zpool_relabel_disk(libzfs_handle_t *hdl, const char *path)
if ((fd = open(path, O_RDWR|O_DIRECT)) < 0) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
if ((fd = open(path, O_RDWR|O_DIRECT)) < 0) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
- "relabel '%s': unable to open device
"), path
);
+ "relabel '%s': unable to open device
: %d"), path, errno
);
return (zfs_error(hdl, EZFS_OPENFAILED, errbuf));
}
return (zfs_error(hdl, EZFS_OPENFAILED, errbuf));
}
@@
-3759,8
+3769,8
@@
zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name)
* This shouldn't happen. We've long since verified that this
* is a valid device.
*/
* This shouldn't happen. We've long since verified that this
* is a valid device.
*/
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "
unable to open device '%s'
: %d"), path, errno);
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"cannot "
+ "
label '%s': unable to open device
: %d"), path, errno);
return (zfs_error(hdl, EZFS_OPENFAILED, errbuf));
}
return (zfs_error(hdl, EZFS_OPENFAILED, errbuf));
}
@@
-3773,8
+3783,8
@@
zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name)
(void) no_memory(hdl);
(void) close(fd);
(void) no_memory(hdl);
(void) close(fd);
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "
unable to read disk capacity"), name
);
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"cannot "
+ "
label '%s': unable to read disk capacity"), path
);
return (zfs_error(hdl, EZFS_NOCAP, errbuf));
}
return (zfs_error(hdl, EZFS_NOCAP, errbuf));
}
@@
-3784,6
+3794,7
@@
zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name)
if (start_block == MAXOFFSET_T)
start_block = NEW_START_BLOCK;
slice_size -= start_block;
if (start_block == MAXOFFSET_T)
start_block = NEW_START_BLOCK;
slice_size -= start_block;
+ slice_size = P2ALIGN(slice_size, PARTITION_END_ALIGNMENT);
vtoc->efi_parts[0].p_start = start_block;
vtoc->efi_parts[0].p_size = slice_size;
vtoc->efi_parts[0].p_start = start_block;
vtoc->efi_parts[0].p_size = slice_size;