Re: [patch] vfs: clear to the end of the buffer on reads

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

 



On Wed, Dec 5, 2012 at 4:44 AM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> READ is zero so this test is always false.  (rw == READ) was intended.

Actually, that really *is* a bitmask, but yeah, the test is wrong.

The correct test is

  ((rw & RW_MASK) == READ)

because the field can have other bits set too (REQ_SYNC or REQ_META or
whatever - read-ahead, other bits)

Alternatively, just "!(rw & WRITE)" I guess.

But thanks for noticing.

                  Linus
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux