Hi, please take a look at this piece of code in zfs_vfsops.c:

int
zfs_mount(vfs_t *vfsp, vnode_t *mvp, struct mounta *uap, cred_t *cr)
{
(..)
        int             canwrite;
(...)
        /*
         * Refuse to mount a filesystem if we are in a local zone and the
         * dataset is not visible.
         */
        if (!INGLOBALZONE(curproc) &&
            (!zone_dataset_visible(osname, &canwrite) || !canwrite)) {
                error = EPERM;
                goto out;
        }
(..)
}

This piece of code has been flagged by the Intel C compiler and I think 
there's a bug here, if I'm not mistaken.

Assuming we are in the global zone, an optimizing compiler would never call 
zone_dataset_visible() since the expression "!INGLOBALZONE(curproc)" would 
evaluate to false. But afterwards, we are checking the value of the variable 
canwrite which hasn't been assigned yet.

Is my analysis correct?

Thanks.

Reply via email to