md: MD_CLOSING needs to be cleared after called md_set_readonly or do_md_stop
authorNeilBrown <neilb@suse.com>
Thu, 6 Apr 2017 03:16:33 +0000 (11:16 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 May 2017 13:44:33 +0000 (15:44 +0200)
commit7e789787878321fc2b1b7869963fa5eeede7402e
tree9d5083a4428a7588fe0ffcbf5b43982ead510994
parentfa9a4a9c6d6ffb21c220418384ed9d89f8c18e35
md: MD_CLOSING needs to be cleared after called md_set_readonly or do_md_stop

commit 065e519e71b2c1f41936cce75b46b5ab34adb588 upstream.

if called md_set_readonly and set MD_CLOSING bit, the mddev cannot
be opened any more due to the MD_CLOING bit wasn't cleared. Thus it
needs to be cleared in md_ioctl after any call to md_set_readonly()
or do_md_stop().

Signed-off-by: NeilBrown <neilb@suse.com>
Fixes: af8d8e6f0315 ("md: changes for MD_STILL_CLOSED flag")
Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/md.c