Skip to content
Commit eedffa28 authored by Jeff Layton's avatar Jeff Layton Committed by Jens Axboe
Browse files

loop: clear wb_err in bd_inode when detaching backing file



When a loop block device encounters a writeback error, that error will
get propagated to the bd_inode's wb_err field. If we then detach the
backing file from it, attach another and fsync it, we'll get back the
writeback error that we had from the previous backing file.

This is a bit of a grey area as POSIX doesn't cover loop devices, but it
is somewhat counterintuitive.

If we detach a backing file from the loopdev while there are still
unreported errors, take it as a sign that we're no longer interested in
the previous file, and clear out the wb_err in the loop blockdev.

Reported-and-Tested-by: default avatarTheodore Y. Ts'o <tytso@mit.edu>
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent f7068114
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment