diff options
author | Yongqiang Yang <xiaoqiangnk@gmail.com> | 2011-10-31 18:04:38 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-10-31 18:04:38 -0400 |
commit | edb5ac8993e25143f6af1ab143843a65c52e2a15 (patch) | |
tree | d7ddf9603bcb2c540d5c240102a0dafc10f42eef /fs | |
parent | 5129d05fda57be13f434dbe8536de39a6c25496d (diff) |
ext4: let ext4_discard_partial_buffers handle unaligned range correctly
As comment says, we should handle unaligned range rather than aligned
one. This fixes a bug found by running xfstests #91.
Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 5fcef98f98e5..de05e86f1993 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -3206,8 +3206,8 @@ int ext4_discard_partial_page_buffers_no_lock(handle_t *handle, | |||
3206 | * to be updated with the contents of the block before | 3206 | * to be updated with the contents of the block before |
3207 | * we write the zeros on top of it. | 3207 | * we write the zeros on top of it. |
3208 | */ | 3208 | */ |
3209 | if (!(from & (blocksize - 1)) || | 3209 | if ((from & (blocksize - 1)) || |
3210 | !((from + length) & (blocksize - 1))) { | 3210 | ((from + length) & (blocksize - 1))) { |
3211 | create_empty_buffers(page, blocksize, 0); | 3211 | create_empty_buffers(page, blocksize, 0); |
3212 | } else { | 3212 | } else { |
3213 | /* | 3213 | /* |