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
Fix unlink/xattr deadlock
[zfs.git]
/
lib
/
libzfs
/
libzfs_util.c
diff --git
a/lib/libzfs/libzfs_util.c
b/lib/libzfs/libzfs_util.c
index
37dba8d
..
f55b658
100644
(file)
--- a/
lib/libzfs/libzfs_util.c
+++ b/
lib/libzfs/libzfs_util.c
@@
-632,15
+632,19
@@
libzfs_module_loaded(const char *module)
}
int
}
int
-libzfs_run_process(const char *path, char *argv[])
+libzfs_run_process(const char *path, char *argv[]
, int flags
)
{
pid_t pid;
int rc;
pid = vfork();
if (pid == 0) {
{
pid_t pid;
int rc;
pid = vfork();
if (pid == 0) {
- close(1);
- close(2);
+ if (!(flags & STDOUT_VERBOSE))
+ close(STDOUT_FILENO);
+
+ if (!(flags & STDERR_VERBOSE))
+ close(STDERR_FILENO);
+
(void) execvp(path, argv);
_exit(-1);
} else if (pid > 0) {
(void) execvp(path, argv);
_exit(-1);
} else if (pid > 0) {
@@
-665,7
+669,7
@@
libzfs_load_module(const char *module)
if (libzfs_module_loaded(module))
return 0;
if (libzfs_module_loaded(module))
return 0;
- return libzfs_run_process("/sbin/modprobe", argv);
+ return libzfs_run_process("/sbin/modprobe", argv
, 0
);
}
libzfs_handle_t *
}
libzfs_handle_t *
@@
-727,9
+731,7
@@
libzfs_fini(libzfs_handle_t *hdl)
#endif
if (hdl->libzfs_sharetab)
(void) fclose(hdl->libzfs_sharetab);
#endif
if (hdl->libzfs_sharetab)
(void) fclose(hdl->libzfs_sharetab);
-#ifdef HAVE_ZPL
zfs_uninit_libshare(hdl);
zfs_uninit_libshare(hdl);
-#endif
if (hdl->libzfs_log_str)
(void) free(hdl->libzfs_log_str);
zpool_free_handles(hdl);
if (hdl->libzfs_log_str)
(void) free(hdl->libzfs_log_str);
zpool_free_handles(hdl);
@@
-1184,11
+1186,14
@@
str2shift(libzfs_handle_t *hdl, const char *buf)
}
/*
}
/*
- *
We want to allow trailing 'b' characters for 'GB' or 'Mb'. But don't
- *
allow 'BB' - that's just weir
d.
+ *
Allow 'G' = 'GB' = 'GiB', case-insensitively.
+ *
However, 'BB' and 'BiB' are disallowe
d.
*/
*/
- if (buf[1] == '\0' || (toupper(buf[1]) == 'B' && buf[2] == '\0' &&
- toupper(buf[0]) != 'B'))
+ if (buf[1] == '\0' ||
+ (toupper(buf[0]) != 'B' &&
+ ((toupper(buf[1]) == 'B' && buf[2] == '\0') ||
+ (toupper(buf[1]) == 'I' && toupper(buf[2]) == 'B' &&
+ buf[3] == '\0'))))
return (10*i);
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
return (10*i);
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,