diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2014-02-27 06:58:04 +0100 |
---|---|---|
committer | Josef Bacik <jbacik@fb.com> | 2014-03-10 20:17:00 +0100 |
commit | c933956ddf80bc455d33cbcf39d35d935daf45a9 (patch) | |
tree | 0417dba0c65787ad3de69f92563e1824086706a6 /fs/btrfs/inode.c | |
parent | btrfs: send: simplify allocation code in fs_path_ensure_buf (diff) | |
download | linux-c933956ddf80bc455d33cbcf39d35d935daf45a9.tar.xz linux-c933956ddf80bc455d33cbcf39d35d935daf45a9.zip |
Btrfs: fix wrong lock range and write size in check_can_nocow()
The write range may not be sector-aligned, for example:
|--------|--------| <- write range, sector-unaligned, size: 2blocks
|--------|--------|--------| <- correct lock range, size: 3blocks
But according to the old code, we used the size of write range to calculate
the lock range directly, not considered the offset, we would get a wrong lock
range:
|--------|--------| <- write range, sector-unaligned, size: 2blocks
|--------|--------| <- wrong lock range, size: 2blocks
And besides that, the old code also had the same problem when calculating
the real write size. Correct them.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Diffstat (limited to 'fs/btrfs/inode.c')
0 files changed, 0 insertions, 0 deletions