linux/fs/btrfs
Josef Bacik a26e8c9f75 Btrfs: don't clear uptodate if the eb is under IO
So I have an awful exercise script that will run snapshot, balance and
send/receive in parallel.  This sometimes would crash spectacularly and when it
came back up the fs would be completely hosed.  Turns out this is because of a
bad interaction of balance and send/receive.  Send will hold onto its entire
path for the whole send, but its blocks could get relocated out from underneath
it, and because it doesn't old tree locks theres nothing to keep this from
happening.  So it will go to read in a slot with an old transid, and we could
have re-allocated this block for something else and it could have a completely
different transid.  But because we think it is invalid we clear uptodate and
re-read in the block.  If we do this before we actually write out the new block
we could write back stale data to the fs, and boom we're screwed.

Now we definitely need to fix this disconnect between send and balance, but we
really really need to not allow ourselves to accidently read in stale data over
new data.  So make sure we check if the extent buffer is not under io before
clearing uptodate, this will kick back EIO to the caller instead of reading in
stale data and keep us from corrupting the fs.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
2014-04-06 17:34:37 -07:00
..
tests
acl.c
async-thread.c btrfs: Add trace for btrfs_workqueue alloc/destroy 2014-03-20 17:15:28 -07:00
async-thread.h btrfs: Add trace for btrfs_workqueue alloc/destroy 2014-03-20 17:15:28 -07:00
backref.c Btrfs: take into account total references when doing backref lookup 2014-03-21 15:28:09 -07:00
backref.h
btrfs_inode.h
check-integrity.c
check-integrity.h
compression.c
compression.h
ctree.c
ctree.h Btrfs: fix possible empty list access when flushing the delalloc inodes 2014-03-10 15:17:29 -04:00
delayed-inode.c btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
delayed-inode.h
delayed-ref.c Btrfs: fix race when updating existing ref head 2014-03-20 17:15:28 -07:00
delayed-ref.h
dev-replace.c Btrfs: don't flush all delalloc inodes when we doesn't get s_umount lock 2014-03-10 15:17:27 -04:00
dev-replace.h
dir-item.c
disk-io.c Btrfs: don't clear uptodate if the eb is under IO 2014-04-06 17:34:37 -07:00
disk-io.h
export.c
export.h
extent-tree.c Btrfs: check for an extent_op on the locked ref 2014-04-06 17:34:36 -07:00
extent_io.c Btrfs: don't clear uptodate if the eb is under IO 2014-04-06 17:34:37 -07:00
extent_io.h Btrfs: don't clear uptodate if the eb is under IO 2014-04-06 17:34:37 -07:00
extent_map.c
extent_map.h
file-item.c
file.c Btrfs: fix a crash of clone with inline extents's split 2014-03-21 17:35:18 -07:00
free-space-cache.c
free-space-cache.h
hash.c
hash.h
inode-item.c
inode-map.c
inode-map.h
inode.c Btrfs: fix possible empty list access when flushing the delalloc inodes 2014-03-10 15:17:29 -04:00
ioctl.c Btrfs: fix a crash of clone with inline extents's split 2014-03-21 17:35:18 -07:00
Kconfig
locking.c
locking.h
lzo.c
Makefile
math.h
ordered-data.c Btrfs: split the global ordered extents mutex 2014-03-10 15:17:28 -04:00
ordered-data.h btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
orphan.c
print-tree.c
print-tree.h
props.c
props.h
qgroup.c btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
raid56.c btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
raid56.h
rcu-string.h
reada.c btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
relocation.c Btrfs: do not reset last_snapshot after relocation 2014-04-06 17:34:35 -07:00
root-tree.c
scrub.c btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
send.c Btrfs: don't clear uptodate if the eb is under IO 2014-04-06 17:34:37 -07:00
send.h
struct-funcs.c
super.c
sysfs.c
sysfs.h
transaction.c Btrfs: don't clear uptodate if the eb is under IO 2014-04-06 17:34:37 -07:00
transaction.h Btrfs: don't clear uptodate if the eb is under IO 2014-04-06 17:34:37 -07:00
tree-defrag.c
tree-log.c
tree-log.h
ulist.c
ulist.h
uuid-tree.c
volumes.c btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
volumes.h btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
xattr.c
xattr.h
zlib.c