]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix preallocation and nodatacow checks in O_DIRECT
authorChris Mason <chris.mason@oracle.com>
Wed, 26 May 2010 15:04:10 +0000 (11:04 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 27 May 2010 01:34:45 +0000 (21:34 -0400)
commit4beed96026912f51b6e519ae9b7c9727c0e98d64
tree3ec1523f7da103a79f71fc5f486596307a4eeb54
parent7b0b03a8719d9d744f427a23d891eda04a638bd9
Btrfs: fix preallocation and nodatacow checks in O_DIRECT

The O_DIRECT code wasn't checking for multiple references
on preallocated or nodatacow extents.  This means it
wasn't honoring snapshots properly.

The fix here is to add an explicit check for multiple references
This also fixes the math for selecting the correct disk block,
making sure not to go past the end of the extent.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c