Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107750711
D13447.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D13447.diff
View Options
Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
@@ -1888,6 +1888,13 @@
}
}
+ error = zvol_check_open(ddra->ddra_oldname);
+ if (error != 0) {
+ dsl_dir_rele(newparent, FTAG);
+ dsl_dir_rele(dd, FTAG);
+ return (error);
+ }
+
dsl_dir_rele(newparent, FTAG);
dsl_dir_rele(dd, FTAG);
return (0);
Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h
@@ -36,6 +36,7 @@
#define ZVOL_ZAP_OBJ 2ULL
#ifdef _KERNEL
+extern int zvol_check_open(const char *);
extern int zvol_check_volsize(uint64_t volsize, uint64_t blocksize);
extern int zvol_check_volblocksize(uint64_t volblocksize);
extern int zvol_get_stats(objset_t *os, nvlist_t *nv);
Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
@@ -3062,6 +3062,24 @@
PICKUP_GIANT();
}
+int
+zvol_check_open(const char *name)
+{
+ zvol_state_t *zv;
+ int rc;
+
+ mutex_enter(&zfsdev_state_lock);
+ if ((zv = zvol_minor_lookup(name)) == NULL) {
+ mutex_exit(&zfsdev_state_lock);
+ return (SET_ERROR(ENXIO));
+ }
+ rc = zv->zv_total_opens;
+ mutex_exit(&zfsdev_state_lock);
+ if (rc > 0)
+ return (SET_ERROR(EBUSY));
+ return (0);
+}
+
static int
zvol_d_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 18, 11:17 PM (21 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15903461
Default Alt Text
D13447.diff (1 KB)
Attached To
Mode
D13447: zfs: deadlock in "zfs rename" if zv_total_opens > 0 since MFV r323535
Attached
Detach File
Event Timeline
Log In to Comment