From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: Re: [patch] vfs: clear to the end of the buffer on reads Date: Wed, 5 Dec 2012 19:59:21 +0300 Message-ID: <20121205165921.GM6568@mwanda> References: <20121205124403.GA31930@elgon.mountain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alexander Viro , linux-fsdevel , kernel-janitors , Romain Francoise , Meelis Roos , Tony Luck To: Linus Torvalds Return-path: Received: from aserp1040.oracle.com ([141.146.126.69]:28074 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751766Ab2LEQ7j (ORCPT ); Wed, 5 Dec 2012 11:59:39 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Dec 05, 2012 at 07:17:16AM -0800, Linus Torvalds wrote: > On Wed, Dec 5, 2012 at 4:44 AM, Dan Carpenter 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) > Ah. Of course. I'll send a v2. regards, dan carpenter