MFp4: Add more debug, so we can see if zpool.cache was loaded or why it

wasn't loaded.
This commit is contained in:
Pawel Jakub Dawidek 2007-04-14 12:23:03 +00:00
parent dbd490e0e2
commit 8870baf005
2 changed files with 22 additions and 6 deletions

View File

@ -85,19 +85,25 @@ spa_config_load(void)
spa_config_dir, ZPOOL_CACHE_FILE);
file = kobj_open_file(pathname);
if (file == (struct _buf *)-1)
if (file == (struct _buf *)-1) {
ZFS_LOG(1, "Cannot open %s.", pathname);
return;
}
if (kobj_get_filesize(file, &fsize) != 0)
if (kobj_get_filesize(file, &fsize) != 0) {
ZFS_LOG(1, "Cannot get size of %s.", pathname);
goto out;
}
buf = kmem_alloc(fsize, KM_SLEEP);
/*
* Read the nvlist from the file.
*/
if (kobj_read_file(file, buf, fsize, 0) < 0)
if (kobj_read_file(file, buf, fsize, 0) < 0) {
ZFS_LOG(1, "Cannot read %s.", pathname);
goto out;
}
/*
* Unpack the nvlist.
@ -105,6 +111,8 @@ spa_config_load(void)
if (nvlist_unpack(buf, fsize, &nvlist, KM_SLEEP) != 0)
goto out;
ZFS_LOG(1, "File %s loaded.", pathname);
/*
* Iterate over all elements in the nvlist, creating a new spa_t for
* each one with the specified configuration.

View File

@ -85,19 +85,25 @@ spa_config_load(void)
spa_config_dir, ZPOOL_CACHE_FILE);
file = kobj_open_file(pathname);
if (file == (struct _buf *)-1)
if (file == (struct _buf *)-1) {
ZFS_LOG(1, "Cannot open %s.", pathname);
return;
}
if (kobj_get_filesize(file, &fsize) != 0)
if (kobj_get_filesize(file, &fsize) != 0) {
ZFS_LOG(1, "Cannot get size of %s.", pathname);
goto out;
}
buf = kmem_alloc(fsize, KM_SLEEP);
/*
* Read the nvlist from the file.
*/
if (kobj_read_file(file, buf, fsize, 0) < 0)
if (kobj_read_file(file, buf, fsize, 0) < 0) {
ZFS_LOG(1, "Cannot read %s.", pathname);
goto out;
}
/*
* Unpack the nvlist.
@ -105,6 +111,8 @@ spa_config_load(void)
if (nvlist_unpack(buf, fsize, &nvlist, KM_SLEEP) != 0)
goto out;
ZFS_LOG(1, "File %s loaded.", pathname);
/*
* Iterate over all elements in the nvlist, creating a new spa_t for
* each one with the specified configuration.