git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Linux 3.8 compat: Support CONFIG_UIDGID_STRICT_TYPE_CHECKS
[zfs.git]
/
module
/
zfs
/
zfs_ctldir.c
diff --git
a/module/zfs/zfs_ctldir.c
b/module/zfs/zfs_ctldir.c
index
a667340
..
b35f27d
100644
(file)
--- a/
module/zfs/zfs_ctldir.c
+++ b/
module/zfs/zfs_ctldir.c
@@
-197,10
+197,11
@@
zfsctl_inode_alloc(zfs_sb_t *zsb, uint64_t id,
zp->z_is_mapped = B_FALSE;
zp->z_is_ctldir = B_TRUE;
zp->z_is_sa = B_FALSE;
zp->z_is_mapped = B_FALSE;
zp->z_is_ctldir = B_TRUE;
zp->z_is_sa = B_FALSE;
+ zp->z_is_stale = B_FALSE;
ip->i_ino = id;
ip->i_mode = (S_IFDIR | S_IRUGO | S_IXUGO);
ip->i_ino = id;
ip->i_mode = (S_IFDIR | S_IRUGO | S_IXUGO);
- ip->i_uid =
0
;
- ip->i_gid =
0
;
+ ip->i_uid =
SUID_TO_KUID(0)
;
+ ip->i_gid =
SGID_TO_KGID(0)
;
ip->i_blkbits = SPA_MINBLOCKSHIFT;
ip->i_atime = now;
ip->i_mtime = now;
ip->i_blkbits = SPA_MINBLOCKSHIFT;
ip->i_atime = now;
ip->i_mtime = now;
@@
-442,7
+443,7
@@
zfsctl_snapdir_lookup(struct inode *dip, char *name, struct inode **ipp,
ZFS_ENTER(zsb);
ZFS_ENTER(zsb);
- error = dmu_snapshot_
id
(zsb->z_os, name, &id);
+ error = dmu_snapshot_
lookup
(zsb->z_os, name, &id);
if (error) {
ZFS_EXIT(zsb);
return (error);
if (error) {
ZFS_EXIT(zsb);
return (error);
@@
-685,7
+686,7
@@
zfsctl_snapdir_inactive(struct inode *ip)
"exec 0</dev/null " \
" 1>/dev/null " \
" 2>/dev/null; " \
"exec 0</dev/null " \
" 1>/dev/null " \
" 2>/dev/null; " \
- "umount -t zfs -n
'%s
%s'"
+ "umount -t zfs -n
%s'
%s'"
static int
__zfsctl_unmount_snapshot(zfs_snapentry_t *sep, int flags)
static int
__zfsctl_unmount_snapshot(zfs_snapentry_t *sep, int flags)
@@
-696,7
+697,7
@@
__zfsctl_unmount_snapshot(zfs_snapentry_t *sep, int flags)
argv[2] = kmem_asprintf(SET_UNMOUNT_CMD,
flags & MNT_FORCE ? "-f " : "", sep->se_path);
argv[2] = kmem_asprintf(SET_UNMOUNT_CMD,
flags & MNT_FORCE ? "-f " : "", sep->se_path);
- error = call_usermodehelper(argv[0], argv, envp,
1
);
+ error = call_usermodehelper(argv[0], argv, envp,
UMH_WAIT_PROC
);
strfree(argv[2]);
/*
strfree(argv[2]);
/*
@@
-731,7
+732,11
@@
zfsctl_unmount_snapshot(zfs_sb_t *zsb, char *name, int flags)
sep = avl_find(&zsb->z_ctldir_snaps, &search, NULL);
if (sep) {
avl_remove(&zsb->z_ctldir_snaps, sep);
sep = avl_find(&zsb->z_ctldir_snaps, &search, NULL);
if (sep) {
avl_remove(&zsb->z_ctldir_snaps, sep);
+ mutex_exit(&zsb->z_ctldir_lock);
+
error = __zfsctl_unmount_snapshot(sep, flags);
error = __zfsctl_unmount_snapshot(sep, flags);
+
+ mutex_enter(&zsb->z_ctldir_lock);
if (error == EBUSY)
avl_add(&zsb->z_ctldir_snaps, sep);
else
if (error == EBUSY)
avl_add(&zsb->z_ctldir_snaps, sep);
else
@@
-766,7
+771,11
@@
zfsctl_unmount_snapshots(zfs_sb_t *zsb, int flags, int *count)
while (sep != NULL) {
next = AVL_NEXT(&zsb->z_ctldir_snaps, sep);
avl_remove(&zsb->z_ctldir_snaps, sep);
while (sep != NULL) {
next = AVL_NEXT(&zsb->z_ctldir_snaps, sep);
avl_remove(&zsb->z_ctldir_snaps, sep);
+ mutex_exit(&zsb->z_ctldir_lock);
+
error = __zfsctl_unmount_snapshot(sep, flags);
error = __zfsctl_unmount_snapshot(sep, flags);
+
+ mutex_enter(&zsb->z_ctldir_lock);
if (error == EBUSY) {
avl_add(&zsb->z_ctldir_snaps, sep);
(*count)++;
if (error == EBUSY) {
avl_add(&zsb->z_ctldir_snaps, sep);
(*count)++;
@@
-822,7
+831,7
@@
zfsctl_mount_snapshot(struct path *path, int flags)
* to safely abort the automount. This should be very rare.
*/
argv[2] = kmem_asprintf(SET_MOUNT_CMD, full_name, full_path);
* to safely abort the automount. This should be very rare.
*/
argv[2] = kmem_asprintf(SET_MOUNT_CMD, full_name, full_path);
- error = call_usermodehelper(argv[0], argv, envp,
1
);
+ error = call_usermodehelper(argv[0], argv, envp,
UMH_WAIT_PROC
);
strfree(argv[2]);
if (error) {
printk("ZFS: Unable to automount %s at %s: %d\n",
strfree(argv[2]);
if (error) {
printk("ZFS: Unable to automount %s at %s: %d\n",
@@
-908,7
+917,7
@@
zfsctl_lookup_objset(struct super_block *sb, uint64_t objsetid, zfs_sb_t **zsbp)
*/
sep = avl_first(&zsb->z_ctldir_snaps);
while (sep != NULL) {
*/
sep = avl_first(&zsb->z_ctldir_snaps);
while (sep != NULL) {
- error = dmu_snapshot_
id
(zsb->z_os, sep->se_name, &id);
+ error = dmu_snapshot_
lookup
(zsb->z_os, sep->se_name, &id);
if (error)
goto out;
if (error)
goto out;