From: Jeff Layton <jlayton@samba.org>
To: Anton Altaparmakov <aia21@cam.ac.uk>
Cc: Steve French <sfrench@samba.org>,
linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
LKML <linux-kernel@vger.kernel.org>,
PWF Linux <pwf-linux@ucs.cam.ac.uk>
Subject: Re: CIFS kernel module bug
Date: Fri, 30 Sep 2011 14:04:09 -0400 [thread overview]
Message-ID: <20110930140409.51c1a94c@tlielax.poochiereds.net> (raw)
In-Reply-To: <A904EFBF-CBC1-4842-9E50-2A556103B8AA@cam.ac.uk>
On Fri, 30 Sep 2011 14:58:58 +0100
Anton Altaparmakov <aia21@cam.ac.uk> wrote:
> Hi,
>
> Looking at the current kernel (in Linus' repository on github) there is a silly logic bug in the cifs module in fs/cifs/cifsfs.c::cifs_llseek() there is this bit of code:
>
> /*
> * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
> * the cached file length
> */
> if (origin != SEEK_SET || origin != SEEK_CUR) {
>
> The logical or should be a logical and, i.e. this should be:
>
> if (origin != SEEK_SET && origin != SEEK_CUR) {
>
> As the code is at present that line is ALWAYS true because origin is ALWAYS either != SEEK_SET or != SEEK_CUR as if it equals one it cannot equal the other and vice versa…
>
> So at the moment it always does the revalidation instead of only for SEEK_END, SEEK_DATA, and SEEK_HOLE.
>
> Best regards,
>
> Anton
Haha, good catch. Care to roll up a patch to fix that?
--
Jeff Layton <jlayton@samba.org>
next prev parent reply other threads:[~2011-09-30 18:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-30 13:58 Anton Altaparmakov
2011-09-30 18:04 ` Jeff Layton [this message]
2011-09-30 18:30 ` Steve French
2011-09-30 21:30 ` Anton Altaparmakov
2011-09-30 22:20 ` Steve French
2011-09-30 23:47 ` Jeremy Allison
2011-10-01 0:34 ` J.P. King
2011-10-01 8:48 ` Anton Altaparmakov
2011-10-01 15:07 ` Lars Müller
2011-10-01 19:53 ` Anton Altaparmakov
2011-10-01 20:22 ` Jim McDonough
2011-10-01 23:14 ` Steve French
2011-10-02 20:16 ` Anton Altaparmakov
2011-10-03 2:44 ` Jeremy Allison
2011-10-03 16:56 ` Lars Müller
2011-10-03 11:17 ` Jeff Layton
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=20110930140409.51c1a94c@tlielax.poochiereds.net \
--to=jlayton@samba.org \
--cc=aia21@cam.ac.uk \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pwf-linux@ucs.cam.ac.uk \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®