Files
linux/drivers
Ilya Dryomov f710ce8ad2 rbd: don't return 0 on unmap if RBD_DEV_FLAG_REMOVING is set
commit 85f5a4d666 upstream.

There is a window between when RBD_DEV_FLAG_REMOVING is set and when
the device is removed from rbd_dev_list.  During this window, we set
"already" and return 0.

Returning 0 from write(2) can confuse userspace tools because
0 indicates that nothing was written.  In particular, "rbd unmap"
will retry the write multiple times a second:

  10:28:05.463299 write(4, "0", 1)        = 0
  10:28:05.463509 write(4, "0", 1)        = 0
  10:28:05.463720 write(4, "0", 1)        = 0
  10:28:05.463942 write(4, "0", 1)        = 0
  10:28:05.464155 write(4, "0", 1)        = 0

Cc: stable@vger.kernel.org
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Tested-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-16 22:12:32 +01:00
..
2018-07-22 14:27:36 +02:00
2018-12-21 14:11:37 +01:00
2018-02-25 11:05:55 +01:00
2017-09-09 17:39:41 +02:00
2019-01-13 10:03:55 +01:00
2018-12-29 13:40:15 +01:00
2016-09-20 20:57:12 +10:00
2018-11-10 07:43:00 -08:00
2018-12-21 14:11:36 +01:00
2018-11-13 11:17:04 -08:00
2018-11-13 11:17:02 -08:00
2019-01-13 10:03:50 +01:00
2018-11-27 16:09:41 +01:00
2018-10-03 17:01:42 -07:00