diff options
author | Mark Shellenbaum <Mark.Shellenbaum@Sun.COM> | 2010-02-25 15:49:58 -0700 |
---|---|---|
committer | Mark Shellenbaum <Mark.Shellenbaum@Sun.COM> | 2010-02-25 15:49:58 -0700 |
commit | 98679b5614193e2e84c0b9fed6d7c0e92bc35509 (patch) | |
tree | f8515b4af556f84024c78a502729c3e8b4594561 /usr | |
parent | b91a2f0bfeae811c56c7acf78dc5e22a22f9480c (diff) | |
download | illumos-gate-98679b5614193e2e84c0b9fed6d7c0e92bc35509.tar.gz |
6863610 ZFS mount can lose correct error return
Diffstat (limited to 'usr')
-rw-r--r-- | usr/src/uts/common/fs/zfs/zfs_vfsops.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/usr/src/uts/common/fs/zfs/zfs_vfsops.c b/usr/src/uts/common/fs/zfs/zfs_vfsops.c index 6759a812ed..8ff7519dff 100644 --- a/usr/src/uts/common/fs/zfs/zfs_vfsops.c +++ b/usr/src/uts/common/fs/zfs/zfs_vfsops.c @@ -1533,8 +1533,7 @@ zfs_mount(vfs_t *vfsp, vnode_t *mvp, struct mounta *uap, cred_t *cr) */ error = secpolicy_fs_mount(cr, mvp, vfsp); if (error) { - error = dsl_deleg_access(osname, ZFS_DELEG_PERM_MOUNT, cr); - if (error == 0) { + if (dsl_deleg_access(osname, ZFS_DELEG_PERM_MOUNT, cr) == 0) { vattr_t vattr; /* @@ -1544,16 +1543,14 @@ zfs_mount(vfs_t *vfsp, vnode_t *mvp, struct mounta *uap, cred_t *cr) vattr.va_mask = AT_UID; - if (error = VOP_GETATTR(mvp, &vattr, 0, cr, NULL)) { + if (VOP_GETATTR(mvp, &vattr, 0, cr, NULL)) { goto out; } if (secpolicy_vnode_owner(cr, vattr.va_uid) != 0 && VOP_ACCESS(mvp, VWRITE, 0, cr, NULL) != 0) { - error = EPERM; goto out; } - secpolicy_fs_mount_clearopts(cr, vfsp); } else { goto out; @@ -1786,9 +1783,8 @@ zfs_umount(vfs_t *vfsp, int fflag, cred_t *cr) ret = secpolicy_fs_unmount(cr, vfsp); if (ret) { - ret = dsl_deleg_access((char *)refstr_value(vfsp->vfs_resource), - ZFS_DELEG_PERM_MOUNT, cr); - if (ret) + if (dsl_deleg_access((char *)refstr_value(vfsp->vfs_resource), + ZFS_DELEG_PERM_MOUNT, cr)) return (ret); } |