* ceph, cifs, nfs, fuse: boolean and / or confusion
@ 2011-12-12 23:06 roel
2011-12-12 23:28 ` Andrew Morton
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: roel @ 2011-12-12 23:06 UTC (permalink / raw)
To: Andrew Morton, LKML, sage, Steve French, linux-cifs,
Miklos Szeredi, fuse-devel, Trond Myklebust, linux-nfs
The test not SEEK_CUR or not SEEK_SET always evaluates to true
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
fs/ceph/file.c | 2 +-
fs/cifs/cifsfs.c | 2 +-
fs/fuse/file.c | 2 +-
fs/nfs/file.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index ce549d3..4d61a66 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -797,7 +797,7 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int origin)
mutex_lock(&inode->i_mutex);
__ceph_do_pending_vmtruncate(inode);
- if (origin != SEEK_CUR || origin != SEEK_SET) {
+ if (origin != SEEK_CUR && origin != SEEK_SET) {
ret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE);
if (ret < 0) {
offset = ret;
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 8f1fe32..f8351c2 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -703,7 +703,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
* origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
* the cached file length
*/
- if (origin != SEEK_SET || origin != SEEK_CUR) {
+ if (origin != SEEK_SET && origin != SEEK_CUR) {
int rc;
struct inode *inode = file->f_path.dentry->d_inode;
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 594f07a..19029e9 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1556,7 +1556,7 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin)
struct inode *inode = file->f_path.dentry->d_inode;
mutex_lock(&inode->i_mutex);
- if (origin != SEEK_CUR || origin != SEEK_SET) {
+ if (origin != SEEK_CUR && origin != SEEK_SET) {
retval = fuse_update_attributes(inode, NULL, file, NULL);
if (retval)
goto exit;
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index eca56d4..606ef0f 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -147,7 +147,7 @@ static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
* origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
* the cached file length
*/
- if (origin != SEEK_SET || origin != SEEK_CUR) {
+ if (origin != SEEK_SET && origin != SEEK_CUR) {
struct inode *inode = filp->f_mapping->host;
int retval = nfs_revalidate_file_size(inode, filp);
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: ceph, cifs, nfs, fuse: boolean and / or confusion
2011-12-12 23:06 ceph, cifs, nfs, fuse: boolean and / or confusion roel
@ 2011-12-12 23:28 ` Andrew Morton
2011-12-12 23:39 ` Trond Myklebust
2011-12-12 23:44 ` drivers/crypto/picoxcell_crypto.c: " Joe Perches
` (2 subsequent siblings)
3 siblings, 1 reply; 15+ messages in thread
From: Andrew Morton @ 2011-12-12 23:28 UTC (permalink / raw)
To: roel
Cc: LKML, sage, Steve French, linux-cifs, Miklos Szeredi, fuse-devel,
Trond Myklebust, linux-nfs
On Tue, 13 Dec 2011 00:06:36 +0100
roel <roel.kluin@gmail.com> wrote:
> The test not SEEK_CUR or not SEEK_SET always evaluates to true
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> fs/ceph/file.c | 2 +-
> fs/cifs/cifsfs.c | 2 +-
> fs/fuse/file.c | 2 +-
> fs/nfs/file.c | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> index ce549d3..4d61a66 100644
> --- a/fs/ceph/file.c
> +++ b/fs/ceph/file.c
> @@ -797,7 +797,7 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int origin)
>
> mutex_lock(&inode->i_mutex);
> __ceph_do_pending_vmtruncate(inode);
> - if (origin != SEEK_CUR || origin != SEEK_SET) {
> + if (origin != SEEK_CUR && origin != SEEK_SET) {
> ret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE);
> if (ret < 0) {
> offset = ret;
> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
> index 8f1fe32..f8351c2 100644
> --- a/fs/cifs/cifsfs.c
> +++ b/fs/cifs/cifsfs.c
> @@ -703,7 +703,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
> * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
> * the cached file length
> */
> - if (origin != SEEK_SET || origin != SEEK_CUR) {
> + if (origin != SEEK_SET && origin != SEEK_CUR) {
> int rc;
> struct inode *inode = file->f_path.dentry->d_inode;
>
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index 594f07a..19029e9 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -1556,7 +1556,7 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin)
> struct inode *inode = file->f_path.dentry->d_inode;
>
> mutex_lock(&inode->i_mutex);
> - if (origin != SEEK_CUR || origin != SEEK_SET) {
> + if (origin != SEEK_CUR && origin != SEEK_SET) {
> retval = fuse_update_attributes(inode, NULL, file, NULL);
> if (retval)
> goto exit;
> diff --git a/fs/nfs/file.c b/fs/nfs/file.c
> index eca56d4..606ef0f 100644
> --- a/fs/nfs/file.c
> +++ b/fs/nfs/file.c
> @@ -147,7 +147,7 @@ static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
> * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
> * the cached file length
> */
> - if (origin != SEEK_SET || origin != SEEK_CUR) {
> + if (origin != SEEK_SET && origin != SEEK_CUR) {
> struct inode *inode = filp->f_mapping->host;
>
> int retval = nfs_revalidate_file_size(inode, filp);
This fix will cause changed runtime behaviour, such as NFS no longer
running nfs_revalidate_file_size() for all seek modes.
So I think it should be reviewed, tested and merged by the various fs
maintainers. Splitting it into four patches would help that process,
but they could independently treat it as a bug report, too.
Meanwhile, I'll put this in my tree so I can keep an eye on people ;)
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: ceph, cifs, nfs, fuse: boolean and / or confusion
2011-12-12 23:28 ` Andrew Morton
@ 2011-12-12 23:39 ` Trond Myklebust
2011-12-12 23:45 ` Trond Myklebust
2011-12-13 14:34 ` Jeff Layton
0 siblings, 2 replies; 15+ messages in thread
From: Trond Myklebust @ 2011-12-12 23:39 UTC (permalink / raw)
To: Andrew Morton
Cc: roel, LKML, sage, Steve French, linux-cifs, Miklos Szeredi,
fuse-devel, linux-nfs
On Mon, 2011-12-12 at 15:28 -0800, Andrew Morton wrote:
> On Tue, 13 Dec 2011 00:06:36 +0100
> roel <roel.kluin@gmail.com> wrote:
>
> > The test not SEEK_CUR or not SEEK_SET always evaluates to true
> >
> > Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> > ---
> > fs/ceph/file.c | 2 +-
> > fs/cifs/cifsfs.c | 2 +-
> > fs/fuse/file.c | 2 +-
> > fs/nfs/file.c | 2 +-
> > 4 files changed, 4 insertions(+), 4 deletions(-)
> >
<snip>
> > diff --git a/fs/nfs/file.c b/fs/nfs/file.c
> > index eca56d4..606ef0f 100644
> > --- a/fs/nfs/file.c
> > +++ b/fs/nfs/file.c
> > @@ -147,7 +147,7 @@ static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
> > * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
> > * the cached file length
> > */
> > - if (origin != SEEK_SET || origin != SEEK_CUR) {
> > + if (origin != SEEK_SET && origin != SEEK_CUR) {
> > struct inode *inode = filp->f_mapping->host;
> >
> > int retval = nfs_revalidate_file_size(inode, filp);
>
> This fix will cause changed runtime behaviour, such as NFS no longer
> running nfs_revalidate_file_size() for all seek modes.
As far as NFS is concerned, it reverts a regression. NFS only used to
run revalidate_file_size() for SEEK_END prior to commit
06222e491e663dac939f04b125c9dc52126a75c4. I accept that we now also need
to run it for SEEK_HOLE and SEEK_DATA, but we've never had to do so for
SEEK_SET and SEEK_CUR.
I suspect the same is true of ceph, cifs etc...
Cheers
Trond
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: ceph, cifs, nfs, fuse: boolean and / or confusion
2011-12-12 23:39 ` Trond Myklebust
@ 2011-12-12 23:45 ` Trond Myklebust
2011-12-12 23:54 ` Andrew Morton
2011-12-13 14:34 ` Jeff Layton
1 sibling, 1 reply; 15+ messages in thread
From: Trond Myklebust @ 2011-12-12 23:45 UTC (permalink / raw)
To: Andrew Morton
Cc: roel, LKML, sage, Steve French, linux-cifs, Miklos Szeredi,
fuse-devel, linux-nfs
On Mon, 2011-12-12 at 18:39 -0500, Trond Myklebust wrote:
> As far as NFS is concerned, it reverts a regression. NFS only used to
> run revalidate_file_size() for SEEK_END prior to commit
> 06222e491e663dac939f04b125c9dc52126a75c4. I accept that we now also need
> to run it for SEEK_HOLE and SEEK_DATA, but we've never had to do so for
> SEEK_SET and SEEK_CUR.
BTW: The regression exists in 3.1, so this is probably a stable
candidate...
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ceph, cifs, nfs, fuse: boolean and / or confusion
2011-12-12 23:45 ` Trond Myklebust
@ 2011-12-12 23:54 ` Andrew Morton
2011-12-13 5:29 ` Sage Weil
0 siblings, 1 reply; 15+ messages in thread
From: Andrew Morton @ 2011-12-12 23:54 UTC (permalink / raw)
To: Trond Myklebust
Cc: roel, LKML, sage, Steve French, linux-cifs, Miklos Szeredi,
fuse-devel, linux-nfs
On Mon, 12 Dec 2011 18:45:11 -0500
Trond Myklebust <Trond.Myklebust@netapp.com> wrote:
> On Mon, 2011-12-12 at 18:39 -0500, Trond Myklebust wrote:
>
> > As far as NFS is concerned, it reverts a regression. NFS only used to
> > run revalidate_file_size() for SEEK_END prior to commit
> > 06222e491e663dac939f04b125c9dc52126a75c4. I accept that we now also need
> > to run it for SEEK_HOLE and SEEK_DATA, but we've never had to do so for
> > SEEK_SET and SEEK_CUR.
>
> BTW: The regression exists in 3.1, so this is probably a stable
> candidate...
>
I'd prefer not to merge this one unless all four fs maintainers have
reviewed and preferably tested it. Also, in view of your earlier email
the changelog for this patch needs updating for NFS and probably other
filesystems.
So please prepare and send the NFS patch, with a Reported-by:roel?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ceph, cifs, nfs, fuse: boolean and / or confusion
2011-12-12 23:54 ` Andrew Morton
@ 2011-12-13 5:29 ` Sage Weil
2011-12-13 11:25 ` Miklos Szeredi
0 siblings, 1 reply; 15+ messages in thread
From: Sage Weil @ 2011-12-13 5:29 UTC (permalink / raw)
To: Andrew Morton
Cc: Trond Myklebust, roel, LKML, Steve French, linux-cifs,
Miklos Szeredi, fuse-devel, linux-nfs
On Mon, 12 Dec 2011, Andrew Morton wrote:
> On Mon, 12 Dec 2011 18:45:11 -0500
> Trond Myklebust <Trond.Myklebust@netapp.com> wrote:
>
> > On Mon, 2011-12-12 at 18:39 -0500, Trond Myklebust wrote:
> >
> > > As far as NFS is concerned, it reverts a regression. NFS only used to
> > > run revalidate_file_size() for SEEK_END prior to commit
> > > 06222e491e663dac939f04b125c9dc52126a75c4. I accept that we now also need
> > > to run it for SEEK_HOLE and SEEK_DATA, but we've never had to do so for
> > > SEEK_SET and SEEK_CUR.
> >
> > BTW: The regression exists in 3.1, so this is probably a stable
> > candidate...
> >
>
> I'd prefer not to merge this one unless all four fs maintainers have
> reviewed and preferably tested it. Also, in view of your earlier email
> the changelog for this patch needs updating for NFS and probably other
> filesystems.
>
> So please prepare and send the NFS patch, with a Reported-by:roel?
I'll push a fix for the ceph bit through my tree. Thanks, roel!
sage
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ceph, cifs, nfs, fuse: boolean and / or confusion
2011-12-13 5:29 ` Sage Weil
@ 2011-12-13 11:25 ` Miklos Szeredi
0 siblings, 0 replies; 15+ messages in thread
From: Miklos Szeredi @ 2011-12-13 11:25 UTC (permalink / raw)
To: Sage Weil
Cc: Andrew Morton, Trond Myklebust, roel, LKML, Steve French,
linux-cifs, fuse-devel, linux-nfs
Sage Weil <sage@newdream.net> writes:
> On Mon, 12 Dec 2011, Andrew Morton wrote:
>>
>> So please prepare and send the NFS patch, with a Reported-by:roel?
Fuse patch follows. Also pushed to git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git for-linus
Thanks Roel.
Miklos
----
>From b48c6af2086ab2ba8a9c9b6ce9ecb34592ce500c Mon Sep 17 00:00:00 2001
From: Roel Kluin <roel.kluin@gmail.com>
Date: Tue, 13 Dec 2011 10:37:00 +0100
Subject: [PATCH] fuse: fix llseek bug
The test in fuse_file_llseek() "not SEEK_CUR or not SEEK_SET" always evaluates
to true.
This was introduced in 3.1 by commit 06222e49 (fs: handle SEEK_HOLE/SEEK_DATA
properly in all fs's that define their own llseek) and changed the behavior of
SEEK_CUR and SEEK_SET to always retrieve the file attributes. This is a
performance regression.
Fix the test so that it makes sense.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: stable@vger.kernel.org
CC: Josef Bacik <josef@redhat.com>
CC: Al Viro <viro@zeniv.linux.org.uk>
---
fs/fuse/file.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 594f07a..19029e9 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1556,7 +1556,7 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin)
struct inode *inode = file->f_path.dentry->d_inode;
mutex_lock(&inode->i_mutex);
- if (origin != SEEK_CUR || origin != SEEK_SET) {
+ if (origin != SEEK_CUR && origin != SEEK_SET) {
retval = fuse_update_attributes(inode, NULL, file, NULL);
if (retval)
goto exit;
--
1.7.7
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: ceph, cifs, nfs, fuse: boolean and / or confusion
2011-12-12 23:39 ` Trond Myklebust
2011-12-12 23:45 ` Trond Myklebust
@ 2011-12-13 14:34 ` Jeff Layton
1 sibling, 0 replies; 15+ messages in thread
From: Jeff Layton @ 2011-12-13 14:34 UTC (permalink / raw)
To: Trond Myklebust
Cc: Andrew Morton, roel, LKML, sage, Steve French, linux-cifs,
Miklos Szeredi, fuse-devel, linux-nfs, josef
On Mon, 12 Dec 2011 18:39:13 -0500
Trond Myklebust <Trond.Myklebust@netapp.com> wrote:
> On Mon, 2011-12-12 at 15:28 -0800, Andrew Morton wrote:
> > On Tue, 13 Dec 2011 00:06:36 +0100
> > roel <roel.kluin@gmail.com> wrote:
> >
> > > The test not SEEK_CUR or not SEEK_SET always evaluates to true
> > >
> > > Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> > > ---
> > > fs/ceph/file.c | 2 +-
> > > fs/cifs/cifsfs.c | 2 +-
> > > fs/fuse/file.c | 2 +-
> > > fs/nfs/file.c | 2 +-
> > > 4 files changed, 4 insertions(+), 4 deletions(-)
> > >
> <snip>
> > > diff --git a/fs/nfs/file.c b/fs/nfs/file.c
> > > index eca56d4..606ef0f 100644
> > > --- a/fs/nfs/file.c
> > > +++ b/fs/nfs/file.c
> > > @@ -147,7 +147,7 @@ static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
> > > * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
> > > * the cached file length
> > > */
> > > - if (origin != SEEK_SET || origin != SEEK_CUR) {
> > > + if (origin != SEEK_SET && origin != SEEK_CUR) {
> > > struct inode *inode = filp->f_mapping->host;
> > >
> > > int retval = nfs_revalidate_file_size(inode, filp);
> >
> > This fix will cause changed runtime behaviour, such as NFS no longer
> > running nfs_revalidate_file_size() for all seek modes.
>
> As far as NFS is concerned, it reverts a regression. NFS only used to
> run revalidate_file_size() for SEEK_END prior to commit
> 06222e491e663dac939f04b125c9dc52126a75c4. I accept that we now also need
> to run it for SEEK_HOLE and SEEK_DATA, but we've never had to do so for
> SEEK_SET and SEEK_CUR.
>
> I suspect the same is true of ceph, cifs etc...
>
(cc'ing Josef Bacik on this too, since he made this change originally)
Agreed. The patch looks correct to me for NFS and CIFS at at least.
--
Jeff Layton <jlayton@redhat.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* drivers/crypto/picoxcell_crypto.c: boolean and / or confusion
2011-12-12 23:06 ceph, cifs, nfs, fuse: boolean and / or confusion roel
2011-12-12 23:28 ` Andrew Morton
@ 2011-12-12 23:44 ` Joe Perches
2011-12-12 23:55 ` drivers/media/video/s5p-fimc/fimc-capture.c: " Joe Perches
2011-12-13 9:50 ` drivers/crypto/picoxcell_crypto.c: " Jamie Iles
2011-12-13 0:02 ` drivers/scsi/bfa/bfa_fcpim.c: " Joe Perches
2011-12-13 0:14 ` drivers/dma/sirf-dma.c: " Joe Perches
3 siblings, 2 replies; 15+ messages in thread
From: Joe Perches @ 2011-12-12 23:44 UTC (permalink / raw)
To: roel, Jamie Iles; +Cc: Andrew Morton, LKML, linux-crypto
On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
> The test not [val1] or not [val2] always evaluates to true
Hey Jamie and Roel
Looking at drivers with:
$ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-]+\s*\|\|\s*\1\s*\!\=" drivers
drivers/crypto/picoxcell_crypto.c: if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) &&
drivers/crypto/picoxcell_crypto.c: } else if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) &&
Most likely these should be && not ||.
^ permalink raw reply [flat|nested] 15+ messages in thread
* drivers/media/video/s5p-fimc/fimc-capture.c: boolean and / or confusion
2011-12-12 23:44 ` drivers/crypto/picoxcell_crypto.c: " Joe Perches
@ 2011-12-12 23:55 ` Joe Perches
2011-12-13 14:26 ` Sylwester Nawrocki
2011-12-13 9:50 ` drivers/crypto/picoxcell_crypto.c: " Jamie Iles
1 sibling, 1 reply; 15+ messages in thread
From: Joe Perches @ 2011-12-12 23:55 UTC (permalink / raw)
To: roel, Kyungmin Park, Sylwester Nawrocki, Mauro Carvalho Chehab
Cc: Andrew Morton, LKML, linux-crypto
On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
> The test not [val1] or not [val2] always evaluates to true
Hello
Looking at drivers with:
$ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-]+\s*\|\|\s*\1\s*\!\=" drivers
drivers/media/video/s5p-fimc/fimc-capture.c: if (mf->width != tfmt->width || mf->width != tfmt->width) {
drivers/media/video/s5p-fimc/fimc-capture.c: if (mf->width != tfmt->width || mf->width != tfmt->width)
Most likely these tests should be:
if (mf->height != tfmt->height || mf->width != tfmt->width)
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: drivers/media/video/s5p-fimc/fimc-capture.c: boolean and / or confusion
2011-12-12 23:55 ` drivers/media/video/s5p-fimc/fimc-capture.c: " Joe Perches
@ 2011-12-13 14:26 ` Sylwester Nawrocki
0 siblings, 0 replies; 15+ messages in thread
From: Sylwester Nawrocki @ 2011-12-13 14:26 UTC (permalink / raw)
To: Joe Perches
Cc: roel, Kyungmin Park, Mauro Carvalho Chehab, Andrew Morton, LKML,
linux-crypto
On 12/13/2011 12:55 AM, Joe Perches wrote:
> On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
>> The test not [val1] or not [val2] always evaluates to true
>
> Hello
>
> Looking at drivers with:
>
> $ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-]+\s*\|\|\s*\1\s*\!\=" drivers
>
> drivers/media/video/s5p-fimc/fimc-capture.c: if (mf->width != tfmt->width || mf->width != tfmt->width) {
> drivers/media/video/s5p-fimc/fimc-capture.c: if (mf->width != tfmt->width || mf->width != tfmt->width)
>
> Most likely these tests should be:
> if (mf->height != tfmt->height || mf->width != tfmt->width)
Indeed. I'll prepare a patch fixing this.
--
Thank you,
Sylwester
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: drivers/crypto/picoxcell_crypto.c: boolean and / or confusion
2011-12-12 23:44 ` drivers/crypto/picoxcell_crypto.c: " Joe Perches
2011-12-12 23:55 ` drivers/media/video/s5p-fimc/fimc-capture.c: " Joe Perches
@ 2011-12-13 9:50 ` Jamie Iles
1 sibling, 0 replies; 15+ messages in thread
From: Jamie Iles @ 2011-12-13 9:50 UTC (permalink / raw)
To: Joe Perches; +Cc: roel, Jamie Iles, Andrew Morton, LKML, linux-crypto
Hi Joe,
On Mon, Dec 12, 2011 at 03:44:53PM -0800, Joe Perches wrote:
> On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
> > The test not [val1] or not [val2] always evaluates to true
>
> Hey Jamie and Roel
>
> Looking at drivers with:
>
> $ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-]+\s*\|\|\s*\1\s*\!\=" drivers
>
> drivers/crypto/picoxcell_crypto.c: if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) &&
> drivers/crypto/picoxcell_crypto.c: } else if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) &&
>
> Most likely these should be && not ||.
Yup, the original code was incorrect. Patch to follow. Thanks Joe!
Jamie
^ permalink raw reply [flat|nested] 15+ messages in thread
* drivers/scsi/bfa/bfa_fcpim.c: boolean and / or confusion
2011-12-12 23:06 ceph, cifs, nfs, fuse: boolean and / or confusion roel
2011-12-12 23:28 ` Andrew Morton
2011-12-12 23:44 ` drivers/crypto/picoxcell_crypto.c: " Joe Perches
@ 2011-12-13 0:02 ` Joe Perches
2011-12-13 0:45 ` Jing Huang
2011-12-13 0:14 ` drivers/dma/sirf-dma.c: " Joe Perches
3 siblings, 1 reply; 15+ messages in thread
From: Joe Perches @ 2011-12-13 0:02 UTC (permalink / raw)
To: roel, Jing Huang, James E.J. Bottomley; +Cc: Andrew Morton, LKML, linux-scsi
On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
> The test not [val1] or not [val2] always evaluates to true
Looking at drivers with:
$ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-]+\s*\)\s*\|\|\s*\(\s*\1\s*\!\=" drivers
drivers/scsi/bfa/bfa_fcpim.c: ((cdb->scsi_cdb[0] != INQUIRY) ||
(cdb->scsi_cdb[0] != REPORT_LUNS))) {
Likely the || should be &&
^ permalink raw reply [flat|nested] 15+ messages in thread* RE: drivers/scsi/bfa/bfa_fcpim.c: boolean and / or confusion
2011-12-13 0:02 ` drivers/scsi/bfa/bfa_fcpim.c: " Joe Perches
@ 2011-12-13 0:45 ` Jing Huang
0 siblings, 0 replies; 15+ messages in thread
From: Jing Huang @ 2011-12-13 0:45 UTC (permalink / raw)
To: Joe Perches, roel, James E.J. Bottomley, Krishna Gudipati
Cc: Andrew Morton, LKML, linux-scsi
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 635 bytes --]
>On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
>> The test not [val1] or not [val2] always evaluates to true
>
>Looking at drivers with:
>
>$ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-
>]+\s*\)\s*\|\|\s*\(\s*\1\s*\!\=" drivers
>
>drivers/scsi/bfa/bfa_fcpim.c: ((cdb->scsi_cdb[0] != INQUIRY) ||
> (cdb->scsi_cdb[0] != REPORT_LUNS))) {
>
>Likely the || should be &&
This is a bug and it should be &&. Will provide a fix.
Thanks
Jing
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 15+ messages in thread
* drivers/dma/sirf-dma.c: boolean and / or confusion
2011-12-12 23:06 ceph, cifs, nfs, fuse: boolean and / or confusion roel
` (2 preceding siblings ...)
2011-12-13 0:02 ` drivers/scsi/bfa/bfa_fcpim.c: " Joe Perches
@ 2011-12-13 0:14 ` Joe Perches
3 siblings, 0 replies; 15+ messages in thread
From: Joe Perches @ 2011-12-13 0:14 UTC (permalink / raw)
To: roel, Barry Song; +Cc: Andrew Morton, LKML, linux-arm-kernel
On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
> The test not [val1] or not [val2] always evaluates to true
Looking at drivers with:
$ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-]+\s*\)\s*\|\|\s*\(\s*\1\s*\!\=" drivers
drivers/dma/sirf-dma.c: if ((xt->dir != DMA_MEM_TO_DEV) || (xt->dir != DMA_DEV_TO_MEM)) {
Likely the || should be &&
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2011-12-13 14:35 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-12 23:06 ceph, cifs, nfs, fuse: boolean and / or confusion roel
2011-12-12 23:28 ` Andrew Morton
2011-12-12 23:39 ` Trond Myklebust
2011-12-12 23:45 ` Trond Myklebust
2011-12-12 23:54 ` Andrew Morton
2011-12-13 5:29 ` Sage Weil
2011-12-13 11:25 ` Miklos Szeredi
2011-12-13 14:34 ` Jeff Layton
2011-12-12 23:44 ` drivers/crypto/picoxcell_crypto.c: " Joe Perches
2011-12-12 23:55 ` drivers/media/video/s5p-fimc/fimc-capture.c: " Joe Perches
2011-12-13 14:26 ` Sylwester Nawrocki
2011-12-13 9:50 ` drivers/crypto/picoxcell_crypto.c: " Jamie Iles
2011-12-13 0:02 ` drivers/scsi/bfa/bfa_fcpim.c: " Joe Perches
2011-12-13 0:45 ` Jing Huang
2011-12-13 0:14 ` drivers/dma/sirf-dma.c: " Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox