Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

userland: avl is broken (was: libzfs export fails to umount all filesystems) #16

Closed
lundman opened this issue May 3, 2013 · 2 comments
Labels

Comments

@lundman
Copy link
Contributor

lundman commented May 3, 2013

During zpool export, the userland libzfs iterates the mounted filesystems to issue zfs_umount. However the mnttab logic is empty.

libzfs_dataset.c:

libzfs_mnttab_add(libzfs_handle_t *hdl, const char *special,
    const char *mountp, const char *mntopts)
{   
    mnttab_node_t *mtn;

    printf("mnttab ADDING '%s'\n", mountp);
# ./zpool.sh create BOOM pool-image.bin
mnttab ADDING 'BOOM'

on export;

libzfs_mount.c:

    printf("disable datasets\n");

    namelen = strlen(zhp->zpool_name);

    used = alloc = 0;
    for (mntn = libzfs_mnttab_first(hdl); mntn != NULL;
         mntn = libzfs_mnttab_next(hdl, mntn)) {
        struct mnttab *mt = &mntn->mtn_mt;

        printf("disable_datasets: '%s'\n",mt->mnt_mountp);
#./zpool.sh export BOOM
disable datasets

Alas, even though we add BOOM to mnttab, the call libzfs_mnttab_first() returns NULL.

@lundman
Copy link
Contributor Author

lundman commented May 23, 2013

After adding a new mount, if I can avl_first, it works as expected.
When it comes in from zpool export, avl_first returns NULL.

I am unsure where AVL are stored, on disk? part of the dataset?

There is a temporary replacement using getfsinfo() in place until it can be fixed.

@lundman
Copy link
Contributor Author

lundman commented Jun 28, 2013

12db36a

Incidentally, the libzfs_mnttab code essentially call mnttab (or rather getmntinfo() on OSX) and builds an avl_list of the mounted file systems, so the temporary work around was not all that bad. But now the greater libzfs_mnttab functions all work as expected and all temporary work-around have been rolled-back.

@lundman lundman closed this as completed Jun 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant