Repository navigation
Commit 435c2ac
nbd: Use invalidate_disk() helper on disconnect
When a nbd device encounters a writeback error, that error will
get propagated to the bd_inode's wb_err field. Then if this nbd
device's backend is disconnected and another is attached, we will
get back the previous writeback error on fsync, which is unexpected.
To fix it, let's use invalidate_disk() helper to invalidate the
disk on disconnect instead of just setting disk's capacity to zero.
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210922123711.187-5-xieyongji@bytedance.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 19f553d commit 435c2ac
1 file changed
Lines changed: 3 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | 313 | | |
322 | 314 | | |
323 | 315 | | |
| |||
1237 | 1229 | | |
1238 | 1230 | | |
1239 | 1231 | | |
1240 | | - | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
1241 | 1235 | | |
1242 | 1236 | | |
1243 | 1237 | | |
| |||
0 commit comments