freebsd-dev/module/zfs
Chunwei Chen d287880afd Fix snapshot automount behavior when concurrent or fail
When concurrent threads accessing the snapdir, one will succeed the user
helper mount while others will get EBUSY. However, the original code treats
those EBUSY threads as success and goes on to do zfsctl_snapshot_add, which
causes repeated avl_add and thus panic.

Also, if the snapshot is already mounted somewhere else, a thread accessing
the snapdir will also get EBUSY from user helper mount. And it will cause
strange things as doing follow_down_one will fail and then follow_up will jump
up to the mountpoint of the filesystem and confuse the hell out of VFS.

The patch fix both behavior by returning 0 immediately for the EBUSY threads.
Note, this will have a side effect for the second case where the VFS will
retry several times before returning ELOOP.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4018
2015-11-19 15:36:59 -08:00
..
arc.c Obey arc_meta_limit default size when changing arc_max 2015-11-13 15:45:22 -08:00
blkptr.c
bplist.c
bpobj.c Illumos 5810 - zdb should print details of bpobj 2015-05-11 15:10:24 -07:00
bptree.c Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
dbuf_stats.c Illumos 5497 - lock contention on arcs_mtx 2015-06-11 10:27:25 -07:00
dbuf.c Illumos 6267 - dn_bonus evicted too early 2015-10-13 14:12:02 -07:00
ddt_zap.c
ddt.c Handle zap_lookup() failure in ddt_object_load() 2015-08-19 14:32:50 -07:00
dmu_diff.c Illumos 5369 - arc flags should be an enum 2015-06-11 10:27:25 -07:00
dmu_object.c
dmu_objset.c Illumos 6267 - dn_bonus evicted too early 2015-10-13 14:12:02 -07:00
dmu_send.c Illumos 5946, 5945 2015-07-06 09:31:30 -07:00
dmu_traverse.c Prevent reclaim in the traverse prefetch thread 2015-09-04 08:43:28 -07:00
dmu_tx.c Illumos 5911 - ZFS "hangs" while deleting file 2015-07-06 09:31:42 -07:00
dmu_zfetch.c
dmu.c zvol processing should use struct bio 2015-09-04 15:30:24 -04:00
dnode_sync.c Illumos 6267 - dn_bonus evicted too early 2015-10-13 14:12:02 -07:00
dnode.c Illumos 5911 - ZFS "hangs" while deleting file 2015-07-06 09:31:42 -07:00
dsl_bookmark.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
dsl_dataset.c Allow recovery from corrupted snapshot maps 2015-08-28 11:56:32 -07:00
dsl_deadlist.c Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
dsl_deleg.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
dsl_destroy.c Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
dsl_dir.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
dsl_pool.c Align thread priority with Linux defaults 2015-07-28 13:36:47 -07:00
dsl_prop.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
dsl_scan.c Illumos 5347 - idle pool may run itself out of space 2015-07-14 10:35:21 -07:00
dsl_synctask.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
dsl_userhold.c Illumos 4951 - ZFS administrative commands should use reserved space 2015-05-04 09:41:10 -07:00
fm.c zfsdev_getminor() should check for invalid file handles 2015-06-22 17:02:13 -07:00
gzip.c
lz4.c
lzjb.c
Makefile.in Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
metaslab.c Disable LBA weighting on files and SSDs 2015-09-01 15:22:07 -07:00
multilist.c Illumos 5497 - lock contention on arcs_mtx 2015-06-11 10:27:25 -07:00
range_tree.c Illumos 5163 - arc should reap range_seg_cache 2015-06-25 08:58:16 -07:00
refcount.c
rrwlock.c Illumos 5008 - lock contention (rrw_exit) while running a read only load 2015-07-06 09:34:13 -07:00
sa.c Illumos 5562 - ZFS sa_handle's violate kmem invariants, debug kernels panic on boot 2015-05-11 15:10:57 -07:00
sha256.c
spa_boot.c
spa_config.c Linux 4.2 compat: vfs_rename() 2015-08-19 16:04:33 -07:00
spa_errlog.c
spa_history.c Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
spa_misc.c Add spa_slop_shift module option 2015-09-02 09:30:18 -07:00
spa_stats.c Illumos 5369 - arc flags should be an enum 2015-06-11 10:27:25 -07:00
spa.c Align thread priority with Linux defaults 2015-07-28 13:36:47 -07:00
space_map.c
space_reftree.c
trace.c Illumos 5497 - lock contention on arcs_mtx 2015-06-11 10:27:25 -07:00
txg.c Align thread priority with Linux defaults 2015-07-28 13:36:47 -07:00
uberblock.c Illumos 5347 - idle pool may run itself out of space 2015-07-14 10:35:21 -07:00
unique.c
vdev_cache.c
vdev_disk.c Fix use-after-free in vdev_disk_physio_completion 2015-10-13 15:25:33 -07:00
vdev_file.c Disable LBA weighting on files and SSDs 2015-09-01 15:22:07 -07:00
vdev_label.c
vdev_mirror.c Illumos #5244 - zio pipeline callers should explicitly invoke next stage 2015-04-30 15:07:47 -07:00
vdev_missing.c Illumos #5244 - zio pipeline callers should explicitly invoke next stage 2015-04-30 15:07:47 -07:00
vdev_queue.c Fix small typo 2015-08-30 10:10:16 -07:00
vdev_raidz.c Illumos #5244 - zio pipeline callers should explicitly invoke next stage 2015-04-30 15:07:47 -07:00
vdev_root.c
vdev.c Disable LBA weighting on files and SSDs 2015-09-01 15:22:07 -07:00
zap_leaf.c Illumos 5314 - Remove "dbuf phys" db->db_data pointer aliases in ZFS 2015-04-28 16:25:20 -07:00
zap_micro.c Add parenthesis to the ternary operator 2015-08-19 11:28:41 -07:00
zap.c Illumos 3654,3656 2015-05-04 09:41:09 -07:00
zfeature_common.c Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
zfeature.c Use cached feature info in spa_add_feature_stats() 2015-03-05 14:11:10 -08:00
zfs_acl.c
zfs_byteswap.c
zfs_ctldir.c Fix snapshot automount behavior when concurrent or fail 2015-11-19 15:36:59 -08:00
zfs_debug.c Add dbgmsg kstat 2015-09-04 16:08:14 -07:00
zfs_dir.c
zfs_fm.c
zfs_fuid.c
zfs_ioctl.c Follow 0/-E convention for module load errors 2015-11-16 16:10:06 -08:00
zfs_log.c Illumos 5027 - zfs large block support 2015-05-11 12:23:16 -07:00
zfs_onexit.c zfsdev_getminor() should check for invalid file handles 2015-06-22 17:02:13 -07:00
zfs_replay.c
zfs_rlock.c
zfs_sa.c Illumos 5056 - ZFS deadlock on db_mtx and dn_holds 2015-04-28 16:25:34 -07:00
zfs_vfsops.c Support accessing .zfs/snapshot via NFS 2015-09-04 13:23:53 -07:00
zfs_vnops.c Fix invalid fileid for snapshot root dentry 2015-09-04 13:23:06 -07:00
zfs_znode.c Fix fail path in zfs_znode_alloc 2015-10-13 15:57:17 -07:00
zil.c Align thread priority with Linux defaults 2015-07-28 13:36:47 -07:00
zio_checksum.c
zio_compress.c Illumos 5661 - ZFS: "compression = on" should use lz4 if feature is enabled 2015-07-10 12:11:45 -07:00
zio_inject.c Illumos 5497 - lock contention on arcs_mtx 2015-06-11 10:27:25 -07:00
zio.c Illumos 5369 - arc flags should be an enum 2015-06-11 10:27:25 -07:00
zle.c
zpl_ctldir.c Linux 3.18 compat: Snapshot auto-mounting 2015-08-31 13:54:39 -07:00
zpl_export.c zfsctl: No need to sync ctldir inodes 2015-08-31 13:54:39 -07:00
zpl_file.c Linux 4.1 compat: loop device on ZFS 2015-08-24 10:17:06 -07:00
zpl_inode.c Linux 3.18 compat: Snapshot auto-mounting 2015-08-31 13:54:39 -07:00
zpl_super.c Disable zpl_nr_cached_objects() callback 2015-09-25 12:45:42 -07:00
zpl_xattr.c Mark additional functions as PF_FSTRANS 2015-04-17 09:35:24 -07:00
zrlock.c Illumos 5812 - assertion failed in zrl_tryenter(): zr_owner==NULL 2015-04-30 14:43:40 -07:00
zvol.c Remove obsolete zv_lock 2015-09-30 10:43:19 -07:00