All of lore.kernel.org
 help / color / mirror / Atom feed
* CIFS  kernel module bug
@ 2011-09-30 13:58 ` Anton Altaparmakov
  0 siblings, 0 replies; 31+ messages in thread
From: Anton Altaparmakov @ 2011-09-30 13:58 UTC (permalink / raw)
  To: Steve French
  Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ, LKML, PWF Linux

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
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer, http://www.linux-ntfs.org/

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2011-10-03 16:56 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-30 13:58 CIFS kernel module bug Anton Altaparmakov
2011-09-30 13:58 ` Anton Altaparmakov
2011-09-30 18:04 ` Jeff Layton
     [not found]   ` <20110930140409.51c1a94c-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2011-09-30 18:30     ` Steve French
2011-09-30 18:30       ` Steve French
2011-09-30 21:30     ` Anton Altaparmakov
2011-09-30 21:30       ` Anton Altaparmakov
2011-09-30 23:47       ` Jeremy Allison
2011-09-30 23:47         ` Jeremy Allison
2011-10-01  0:34         ` J.P. King
2011-10-01  0:34           ` J.P. King
     [not found]           ` <alpine.LSU.2.00.1110010122210.15683-rNEEB5iaIwQgWVoWv9+vLtDNj2e20MGE@public.gmane.org>
2011-10-01  8:48             ` Anton Altaparmakov
2011-10-01  8:48               ` Anton Altaparmakov
     [not found]               ` <6704F264-5437-4948-8C1B-FE3F5CE59C24-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2011-10-01 15:07                 ` Lars Müller
2011-10-01 15:07                   ` Lars Müller
     [not found]                   ` <20111001150730.GJ5170-jzW0CqpAA0Me6aEkudXLsA@public.gmane.org>
2011-10-01 19:53                     ` Anton Altaparmakov
2011-10-01 19:53                       ` Anton Altaparmakov
     [not found]                       ` <6A5AB13C-F313-4BF2-A402-F41AB53493F0-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2011-10-01 20:22                         ` Jim McDonough
2011-10-01 20:22                           ` Jim McDonough
2011-10-01 23:14                           ` Steve French
2011-10-01 23:14                             ` Steve French
     [not found]                           ` <CAFneQcc8D7ho-Yfr2X0DxaLLX11iMU=wSgCw9daKoViZCMk6dA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-02 20:16                             ` Anton Altaparmakov
2011-10-02 20:16                               ` Anton Altaparmakov
2011-10-03  2:44                               ` Jeremy Allison
2011-10-03  2:44                                 ` Jeremy Allison
     [not found]                               ` <65C75335-2A74-4B00-989A-212BAC06A646-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2011-10-03 16:56                                 ` Lars Müller
2011-10-03 16:56                                   ` Lars Müller
     [not found]       ` <E35BF115-B84D-4DB2-BDDC-E356052282F2-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2011-09-30 22:20         ` Steve French
2011-09-30 22:20           ` Steve French
2011-10-03 11:17         ` Jeff Layton
2011-10-03 11:17           ` Jeff Layton

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.