remarkable-linux/drivers/md
Guoqing Jiang af8d8e6f03 md: changes for MD_STILL_CLOSED flag
When stop clustered raid while it is pending on resync,
MD_STILL_CLOSED flag could be cleared since udev rule
is triggered to open the mddev. So obviously array can't
be stopped soon and returns EBUSY.

	mdadm -Ss          md-raid-arrays.rules
  set MD_STILL_CLOSED          md_open()
	... ... ...          clear MD_STILL_CLOSED
	do_md_stop

We make below changes to resolve this issue:

1. rename MD_STILL_CLOSED to MD_CLOSING since it is set
   when stop array and it means we are stopping array.
2. let md_open returns early if CLOSING is set, so no
   other threads will open array if one thread is trying
   to close it.
3. no need to clear CLOSING bit in md_open because 1 has
   ensure the bit is cleared, then we also don't need to
   test CLOSING bit in do_md_stop.

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
2016-09-21 09:09:44 -07:00
..
bcache bcache: pr_err: more meaningful error message when nr_stripes is invalid 2016-08-18 20:31:03 -07:00
persistent-data dm btree: fix a bug in dm_btree_find_next_single() 2016-07-20 12:43:34 -04:00
bitmap.c MD: hold mddev lock to change bitmap location 2016-08-05 22:02:40 -07:00
bitmap.h
dm-bio-prison.c
dm-bio-prison.h
dm-bio-record.h
dm-bufio.c dm bufio: remove use of deprecated create_singlethread_workqueue() 2016-08-30 19:45:20 -04:00
dm-bufio.h
dm-builtin.c dm: move request-based code out to dm-rq.[hc] 2016-06-10 15:15:44 -04:00
dm-cache-block-types.h
dm-cache-metadata.c
dm-cache-metadata.h
dm-cache-policy-cleaner.c
dm-cache-policy-internal.h
dm-cache-policy-smq.c
dm-cache-policy.c
dm-cache-policy.h
dm-cache-target.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm-core.h dm: move request-based code out to dm-rq.[hc] 2016-06-10 15:15:44 -04:00
dm-crypt.c dm crypt: fix free of bad values after tfm allocation failure 2016-08-30 19:45:19 -04:00
dm-delay.c
dm-era-target.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm-exception-store.c
dm-exception-store.h
dm-flakey.c dm flakey: fix reads to be issued if drop_writes configured 2016-08-24 21:55:05 -04:00
dm-io.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm-ioctl.c dm: allow bio-based table to be upgraded to bio-based with DAX support 2016-07-20 23:49:52 -04:00
dm-kcopyd.c dm: move request-based code out to dm-rq.[hc] 2016-06-10 15:15:44 -04:00
dm-linear.c libnvdimm for 4.8 2016-07-28 17:38:16 -07:00
dm-log-userspace-base.c
dm-log-userspace-transfer.c
dm-log-userspace-transfer.h
dm-log-writes.c dm log writes: fix check of kthread_run() return value 2016-08-30 19:41:43 -04:00
dm-log.c dm log: fix unitialized bio operation flags 2016-08-24 21:55:05 -04:00
dm-mpath.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-queue-length.c
dm-raid.c dm raid: support raid0 with missing metadata devices 2016-08-17 10:42:39 -04:00
dm-raid1.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm-region-hash.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm-round-robin.c dm round robin: do not use this_cpu_ptr() without having preemption disabled 2016-08-15 09:23:14 -04:00
dm-rq.c dm rq: fix the starting and stopping of blk-mq queues 2016-08-02 16:21:36 -04:00
dm-rq.h dm mpath: add optional "queue_mode" feature 2016-06-10 15:16:02 -04:00
dm-service-time.c
dm-snap-persistent.c dm: use bio op accessors 2016-06-07 13:41:38 -06:00
dm-snap-transient.c
dm-snap.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm-stats.c dm: move request-based code out to dm-rq.[hc] 2016-06-10 15:15:44 -04:00
dm-stats.h
dm-stripe.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm-switch.c
dm-sysfs.c dm: move request-based code out to dm-rq.[hc] 2016-06-10 15:15:44 -04:00
dm-table.c dm error: add DAX support 2016-07-20 23:49:50 -04:00
dm-target.c libnvdimm for 4.8 2016-07-28 17:38:16 -07:00
dm-thin-metadata.c dm thin: fix a race condition between discarding and provisioning a block 2016-07-20 12:43:35 -04:00
dm-thin-metadata.h dm thin: fix a race condition between discarding and provisioning a block 2016-07-20 12:43:35 -04:00
dm-thin.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm-uevent.c
dm-uevent.h
dm-verity-fec.c dm verity fec: fix block calculation 2016-07-01 23:29:08 -04:00
dm-verity-fec.h
dm-verity-target.c
dm-verity.h
dm-zero.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
dm.h dm: add infrastructure for DAX support 2016-07-20 23:49:49 -04:00
faulty.c
Kconfig
linear.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
linear.h
Makefile dm: move request-based code out to dm-rq.[hc] 2016-06-10 15:15:44 -04:00
md-cluster.c md-cluster: remove some unnecessary dlm_unlock_sync 2016-09-21 09:09:44 -07:00
md-cluster.h md-cluster: gather resync infos and enable recv_thread after bitmap is ready 2016-05-09 09:24:03 -07:00
md.c md: changes for MD_STILL_CLOSED flag 2016-09-21 09:09:44 -07:00
md.h md: changes for MD_STILL_CLOSED flag 2016-09-21 09:09:44 -07:00
multipath.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
multipath.h
raid0.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
raid0.h
raid1.c block: rename bio bi_rw to bi_opf 2016-08-07 14:41:02 -06:00
raid1.h
raid5-cache.c raid5-cache: fix a deadlock in superblock write 2016-08-31 09:05:18 -07:00
raid5.c raid5: fix a small race condition 2016-09-09 11:09:19 -07:00
raid5.h
raid10.c Merge tag 'md/4.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md 2016-08-30 11:24:04 -07:00
raid10.h raid10: improve random reads performance 2016-07-19 15:20:28 -07:00