All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Romain Francoise <romain@orebokech.com>,
	Meelis Roos <mroos@linux.ee>, Tony Luck <tony.luck@intel.com>
Subject: [patch] vfs: clear to the end of the buffer on reads
Date: Wed, 05 Dec 2012 12:44:03 +0000	[thread overview]
Message-ID: <20121205124403.GA31930@elgon.mountain> (raw)

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);

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Romain Francoise <romain@orebokech.com>,
	Meelis Roos <mroos@linux.ee>, Tony Luck <tony.luck@intel.com>
Subject: [patch] vfs: clear to the end of the buffer on reads
Date: Wed, 5 Dec 2012 15:44:03 +0300	[thread overview]
Message-ID: <20121205124403.GA31930@elgon.mountain> (raw)

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);

             reply	other threads:[~2012-12-05 12:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-05 12:44 Dan Carpenter [this message]
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 15:17   ` Linus Torvalds
2012-12-05 16:59   ` Dan Carpenter
2012-12-05 16:59     ` Dan Carpenter
2012-12-05 17:01   ` [patch v2] " Dan Carpenter
2012-12-05 17:01     ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121205124403.GA31930@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mroos@linux.ee \
    --cc=romain@orebokech.com \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.