Re: [PATCH 3/3] ext4: let ext4_discard_partial_buffers handle unaligned range correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Forgot to say that the bug was found by running xfstests 91.

Thx!

Yongqiang.

On Sun, Oct 30, 2011 at 7:30 PM, Yongqiang Yang <xiaoqiangnk@xxxxxxxxx> wrote:
> As comment says, we should handle unaligned range rather than aligned
> one.
>
> Signed-off-by: Yongqiang Yang <xiaoqiangnk@xxxxxxxxx>
> ---
>  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 e113de8..f97d671 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -3209,8 +3209,8 @@ int ext4_discard_partial_page_buffers_no_lock(handle_t *handle,
>                 * to be updated with the contents of the block before
>                 * we write the zeros on top of it.
>                 */
> -               if (!(from & (blocksize - 1)) ||
> -                   !((from + length) & (blocksize - 1))) {
> +               if ((from & (blocksize - 1)) ||
> +                   ((from + length) & (blocksize - 1))) {
>                        create_empty_buffers(page, blocksize, 0);
>                } else {
>                        /*
> --
> 1.7.5.1
>
>



-- 
Best Wishes
Yongqiang Yang
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux