linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] vfs: clear to the end of the buffer on reads
@ 2012-12-05 12:44 Dan Carpenter
  2012-12-05 15:17 ` Linus Torvalds
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2012-12-05 12:44 UTC (permalink / raw)
  To: Alexander Viro, Linus Torvalds
  Cc: linux-fsdevel, kernel-janitors, Romain Francoise, Meelis Roos,
	Tony Luck

READ is zero so this test is always false.  (rw == READ) was intended.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/buffer.c b/fs/buffer.c
index 70ed4d8..e0a59c6 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2931,7 +2931,7 @@ static void guard_bh_eod(int rw, struct bio *bio, struct buffer_head *bh)
 	bio->bi_io_vec[0].bv_len = bytes;
 
 	/* ..and clear the end of the buffer for reads */
-	if (rw & READ) {
+	if (rw == READ) {
 		void *kaddr = kmap_atomic(bh->b_page);
 		memset(kaddr + bh_offset(bh) + bytes, 0, bh->b_size - bytes);
 		kunmap_atomic(kaddr);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-05 17:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-05 12:44 [patch] vfs: clear to the end of the buffer on reads Dan Carpenter
2012-12-05 15:17 ` Linus Torvalds
2012-12-05 16:59   ` Dan Carpenter
2012-12-05 17:01   ` [patch v2] " Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).