diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-12-05 12:01:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-05 13:32:59 -0500 |
commit | 27d7c2a006a81c04fab00b8cd81b99af3b32738d (patch) | |
tree | d04b7860b79d70b5c1ebedc964ffa1cc8fee261e /fs/buffer.c | |
parent | df2fc246c8ee8b6067af1fa55d3bc23107457f61 (diff) |
vfs: clear to the end of the buffer on partial buffer reads
READ is zero so the "rw & READ" test is always false. The intended test
was "((rw & RW_MASK) == READ)".
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index c4e11390a44c..ec0aca8ba6bf 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -2935,7 +2935,7 @@ static void guard_bh_eod(int rw, struct bio *bio, struct buffer_head *bh) | |||
2935 | bio->bi_io_vec[0].bv_len = bytes; | 2935 | bio->bi_io_vec[0].bv_len = bytes; |
2936 | 2936 | ||
2937 | /* ..and clear the end of the buffer for reads */ | 2937 | /* ..and clear the end of the buffer for reads */ |
2938 | if (rw & READ) { | 2938 | if ((rw & RW_MASK) == READ) { |
2939 | void *kaddr = kmap_atomic(bh->b_page); | 2939 | void *kaddr = kmap_atomic(bh->b_page); |
2940 | memset(kaddr + bh_offset(bh) + bytes, 0, bh->b_size - bytes); | 2940 | memset(kaddr + bh_offset(bh) + bytes, 0, bh->b_size - bytes); |
2941 | kunmap_atomic(kaddr); | 2941 | kunmap_atomic(kaddr); |