diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2019-01-08 21:47:38 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-17 00:04:36 +0300 |
commit | 997255351a29c1a5c8ad0456877c587301f0dc51 (patch) | |
tree | b9b3fc18413806c846f91f261faeb651fddf0560 /fs | |
parent | c7ca8e94dbb5cf81de178d8658d7861b1cf15444 (diff) | |
download | linux-997255351a29c1a5c8ad0456877c587301f0dc51.tar.xz |
rbd: don't return 0 on unmap if RBD_DEV_FLAG_REMOVING is set
commit 85f5a4d666fd9be73856ed16bb36c5af5b406b29 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>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions