mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* CIFS  kernel module bug
@ 2011-09-30 13:58 Anton Altaparmakov
  2011-09-30 18:04 ` Jeff Layton
  0 siblings, 1 reply; 16+ messages in thread
From: Anton Altaparmakov @ 2011-09-30 13:58 UTC (permalink / raw)
  To: Steve French; +Cc: linux-cifs, samba-technical, 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] 16+ messages in thread

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

Thread overview: 16+ 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 18:04 ` Jeff Layton
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

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®