diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2011-09-07 22:26:51 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2011-10-20 12:10:44 -0400 |
commit | f0dd9592a1aa014b3a01aa2be7e795aae040d65b (patch) | |
tree | a57eaec0eb40c490254af749c2bda77534002e9e /fs/btrfs/inode.c | |
parent | 560f7d75457f86a43970aa413e334e394082dce4 (diff) |
Btrfs: fix direct-io vs nodatacow
To reproduce the bug:
# mount -o nodatacow /dev/sda7 /mnt/
# dd if=/dev/zero of=/mnt/tmp bs=4K count=1
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 0.000136115 s, 30.1 MB/s
# dd if=/dev/zero of=/mnt/tmp bs=4K count=1 conv=notrunc oflag=direct
dd: writing `/mnt/tmp': Input/output error
1+0 records in
0+0 records out
btrfs_ordered_update_i_size() may return 1, but btrfs_endio_direct_write()
mistakenly takes it as an error.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 81d4f68f35c9..65474d95f26f 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -5777,8 +5777,7 @@ again: | |||
5777 | if (test_bit(BTRFS_ORDERED_NOCOW, &ordered->flags)) { | 5777 | if (test_bit(BTRFS_ORDERED_NOCOW, &ordered->flags)) { |
5778 | ret = btrfs_ordered_update_i_size(inode, 0, ordered); | 5778 | ret = btrfs_ordered_update_i_size(inode, 0, ordered); |
5779 | if (!ret) | 5779 | if (!ret) |
5780 | ret = btrfs_update_inode(trans, root, inode); | 5780 | err = btrfs_update_inode(trans, root, inode); |
5781 | err = ret; | ||
5782 | goto out; | 5781 | goto out; |
5783 | } | 5782 | } |
5784 | 5783 | ||