diff options
author | Josef Bacik <jbacik@fusionio.com> | 2013-02-21 15:28:28 -0500 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-02-26 10:57:48 -0500 |
commit | f2bdf9a8f79052e9577936cbe5696c0e232aa0e3 (patch) | |
tree | ba7840304d4859579ddddd36e66f9e6bfe3bbfb8 /fs/btrfs/inode.c | |
parent | dc81cdc58ad2f413b96b9004f8d681e5dc554473 (diff) |
Btrfs: make sure NODATACOW also gets NODATASUM set
A user reported hitting the BUG_ON() in btrfs_finished_ordered_io() where we had
csums on a NOCOW extent. This can happen if we have NODATACOW set but not
NODATASUM set, which can happen in two cases, either we mount with -o nodatacow
and then write into preallocated space, or chattr +C a directory and move a file
into that directory. Liu has fixed the move case in a different place, but this
fixes the mount -o nodatacow case. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 40d49da5e846..14c82cdbb696 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -5574,7 +5574,8 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | |||
5574 | if (btrfs_test_opt(root, NODATASUM)) | 5574 | if (btrfs_test_opt(root, NODATASUM)) |
5575 | BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; | 5575 | BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; |
5576 | if (btrfs_test_opt(root, NODATACOW)) | 5576 | if (btrfs_test_opt(root, NODATACOW)) |
5577 | BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW; | 5577 | BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW | |
5578 | BTRFS_INODE_NODATASUM; | ||
5578 | } | 5579 | } |
5579 | 5580 | ||
5580 | insert_inode_hash(inode); | 5581 | insert_inode_hash(inode); |