Refresh linux-legacy
This commit is contained in:
parent
9baaa468ac
commit
da020cdf3b
18
.topmsg
18
.topmsg
|
@ -1,19 +1,7 @@
|
|||
From: Brian Behlendorf <behlendorf1@llnl.gov>
|
||||
Subject: [PATCH] zfs branch
|
||||
Subject: [PATCH] linux legacy
|
||||
|
||||
Merged result of all changes which are relevant to both Solaris
|
||||
and Linux builds of the ZFS code. These are changes where there
|
||||
is a reasonable chance they will be accepted upstream.
|
||||
|
||||
Additionally, since this is effectively the root of the linux
|
||||
ZFS tree the core linux build system is added here. This
|
||||
includes autogen.sh, configure.ac, m4 macros, some scripts/*,
|
||||
and makefiles for all the core ZFS components. Linux-only
|
||||
features which require tweaks to the build system should appear
|
||||
on the relevant topic branches. All autotools products which
|
||||
result from autogen.sh are commited to the linux-configure-branch.
|
||||
|
||||
This branch also contains the META, ChangeLog, AUTHORS,
|
||||
README, and GIT files.
|
||||
Do not use openat() and fdopendir() since they are not available
|
||||
on older systems.
|
||||
|
||||
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
|
||||
|
|
|
@ -791,7 +791,7 @@ zpool_find_import_impl(libzfs_handle_t *hdl, int argc, char **argv,
|
|||
int i;
|
||||
DIR *dirp = NULL;
|
||||
struct dirent64 *dp;
|
||||
char path[MAXPATHLEN];
|
||||
char path[MAXPATHLEN], path2[MAXPATHLEN];
|
||||
char *end;
|
||||
size_t pathleft;
|
||||
struct stat64 statbuf;
|
||||
|
@ -818,7 +818,6 @@ zpool_find_import_impl(libzfs_handle_t *hdl, int argc, char **argv,
|
|||
*/
|
||||
for (i = 0; i < argc; i++) {
|
||||
char *rdsk;
|
||||
int dfd;
|
||||
|
||||
/* use realpath to normalize the path */
|
||||
if (realpath(argv[i], path) == 0) {
|
||||
|
@ -842,8 +841,7 @@ zpool_find_import_impl(libzfs_handle_t *hdl, int argc, char **argv,
|
|||
else
|
||||
rdsk = path;
|
||||
|
||||
if ((dfd = open64(rdsk, O_RDONLY)) < 0 ||
|
||||
(dirp = fdopendir(dfd)) == NULL) {
|
||||
if ((dirp = opendir(rdsk)) == NULL) {
|
||||
zfs_error_aux(hdl, strerror(errno));
|
||||
(void) zfs_error_fmt(hdl, EZFS_BADPATH,
|
||||
dgettext(TEXT_DOMAIN, "cannot open '%s'"),
|
||||
|
@ -860,20 +858,19 @@ zpool_find_import_impl(libzfs_handle_t *hdl, int argc, char **argv,
|
|||
(name[1] == 0 || (name[1] == '.' && name[2] == 0)))
|
||||
continue;
|
||||
|
||||
if ((fd = openat64(dfd, name, O_RDONLY)) < 0)
|
||||
continue;
|
||||
snprintf(path2, sizeof (path2), "%s%s", rdsk, name);
|
||||
|
||||
/*
|
||||
* Ignore failed stats. We only want regular
|
||||
* files, character devs and block devs.
|
||||
*/
|
||||
if (fstat64(fd, &statbuf) != 0 ||
|
||||
if (stat64(path2, &statbuf) != 0 ||
|
||||
(!S_ISREG(statbuf.st_mode) &&
|
||||
!S_ISCHR(statbuf.st_mode) &&
|
||||
!S_ISBLK(statbuf.st_mode))) {
|
||||
(void) close(fd);
|
||||
!S_ISBLK(statbuf.st_mode)))
|
||||
continue;
|
||||
|
||||
if ((fd = open64(path2, O_RDONLY)) < 0)
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((zpool_read_label(fd, &config)) != 0) {
|
||||
(void) close(fd);
|
||||
|
@ -906,9 +903,7 @@ zpool_find_import_impl(libzfs_handle_t *hdl, int argc, char **argv,
|
|||
config = NULL;
|
||||
continue;
|
||||
}
|
||||
/* use the non-raw path for the config */
|
||||
(void) strlcpy(end, name, pathleft);
|
||||
if (add_config(hdl, &pools, path, config) != 0)
|
||||
if (add_config(hdl, &pools, path2, config) != 0)
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue