Bug 417961

Summary: Update CIFS for RHEL5.2
Product: Red Hat Enterprise Linux 5 Reporter: Jeff Layton <jlayton>
Component: kernelAssignee: Jeff Layton <jlayton>
Status: CLOSED ERRATA QA Contact: Martin Jenner <mjenner>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.1CC: coughlan, jlieskov, lmcilroy, qcai, staubach, steved, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0314 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 15:03:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
tarball with backport of cifs-1.50 for older kernels
none
patch 1 -- update RHEL5's cifs code to 1.50c
none
patch 2 -- remove duplicate inc_nlink definition
none
patch 3 -- don't include config.h
none
patch 4 -- fix bad handling of EAGAIN error on kernel_recvmsg in cifs_demultiplex_thread
none
patch 5 -- Fix spurious reconnect on 2nd peek from read of SMB length
none
patch 6 -- fix oops on second mount to same server when null auth is used
none
patch 7 -- log better errors on failed mounts
none
patch 8 -- Fix buffer overflow if server sends corrupt response to small request
none
patch 9 -- Fix memory leak in statfs to very old servers
none
patch 10 -- Reduce chance of list corruption in find_writable_file
none
patch 11 -- Fix cifsd so shuts down when signing fails during mount
none
patch 12 -- fix error message about packet signing
none
patch 13 -- when mount helper missing fix slash wrong direction in share
none
patch 14 -- Fix potential data corruption when writing out cached dirty pages
none
patch 15 -- Fix endian conversion problem in posix mkdir
none
patch 16 -- update CHANGES file and version string none

Description Jeff Layton 2007-12-10 12:15:26 UTC
There are a number of upstream fixes that have gone into CIFS that we need to
consider for 5.2. This bug is for tracking them.

Comment 1 Jeff Layton 2007-12-10 20:17:04 UTC
Created attachment 283091 [details]
tarball with backport of cifs-1.50 for older kernels

Tarball containing Steve French's backport of upstream cifs-1.50 code to older
kernels.

Comment 2 Jeff Layton 2007-12-10 20:18:03 UTC
Created attachment 283101 [details]
patch 1 -- update RHEL5's cifs code to 1.50c

Comment 3 Jeff Layton 2007-12-10 20:18:28 UTC
Created attachment 283111 [details]
patch 2 -- remove duplicate inc_nlink definition

Comment 4 Jeff Layton 2007-12-10 20:18:55 UTC
Created attachment 283121 [details]
patch 3 -- don't include config.h

Comment 5 Jeff Layton 2007-12-10 20:19:44 UTC
Created attachment 283131 [details]
patch 4 -- fix bad handling of EAGAIN error on kernel_recvmsg in cifs_demultiplex_thread

Comment 6 Jeff Layton 2007-12-10 20:20:11 UTC
Created attachment 283141 [details]
patch 5 -- Fix spurious reconnect on 2nd peek from read of SMB length

Comment 7 Jeff Layton 2007-12-10 20:20:29 UTC
Created attachment 283151 [details]
patch 6 -- fix oops on second mount to same server when null auth is used

Comment 8 Jeff Layton 2007-12-10 20:20:59 UTC
Created attachment 283161 [details]
patch 7 -- log better errors on failed mounts

Comment 9 Jeff Layton 2007-12-10 20:21:33 UTC
Created attachment 283171 [details]
patch 8 -- Fix buffer overflow if server sends corrupt response to small request

Comment 10 Jeff Layton 2007-12-10 20:21:53 UTC
Created attachment 283181 [details]
patch 9 -- Fix memory leak in statfs to very old servers

Comment 11 Jeff Layton 2007-12-10 20:22:12 UTC
Created attachment 283191 [details]
patch 10 -- Reduce chance of list corruption in find_writable_file

Comment 12 Jeff Layton 2007-12-10 20:22:39 UTC
Created attachment 283201 [details]
patch 11 -- Fix cifsd so shuts down when signing fails during mount

Comment 13 Jeff Layton 2007-12-10 20:23:01 UTC
Created attachment 283211 [details]
patch 12 -- fix error message about packet signing

Comment 14 Jeff Layton 2007-12-10 20:23:40 UTC
Created attachment 283221 [details]
patch 13 -- when mount helper missing fix slash wrong direction in share

Comment 15 Jeff Layton 2007-12-10 20:24:03 UTC
Created attachment 283231 [details]
patch 14 -- Fix potential data corruption when writing out cached dirty pages

Comment 16 Jeff Layton 2007-12-10 20:24:24 UTC
Created attachment 283241 [details]
patch 15 -- Fix endian conversion problem in posix mkdir

Comment 17 Jeff Layton 2007-12-10 20:24:51 UTC
Created attachment 283251 [details]
patch 16 -- update CHANGES file and version string

Comment 18 Jeff Layton 2007-12-10 20:26:36 UTC
I'm building a set of test kernels with this patchset now and plan to spend
significant time over the next few days running regression tests on it.

Cursory hello-world style testing so far looks good...


Comment 20 RHEL Program Management 2007-12-11 15:15:36 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 23 Jeff Layton 2007-12-17 12:17:34 UTC
*** Bug 373741 has been marked as a duplicate of this bug. ***

Comment 24 Jeff Layton 2007-12-19 16:44:30 UTC
*** Bug 414151 has been marked as a duplicate of this bug. ***

Comment 25 Jeff Layton 2007-12-19 16:44:50 UTC
*** Bug 287401 has been marked as a duplicate of this bug. ***

Comment 26 Jeff Layton 2007-12-19 16:45:17 UTC
*** Bug 373001 has been marked as a duplicate of this bug. ***

Comment 27 Jeff Layton 2007-12-19 16:45:58 UTC
*** Bug 329431 has been marked as a duplicate of this bug. ***

Comment 28 Don Zickus 2007-12-21 20:18:35 UTC
in 2.6.18-62.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Comment 33 Issue Tracker 2008-02-01 23:32:18 UTC
Have run into other problems using directio in the cifs mount options, so
this isn't going to help them work around the behavior they are seeing. 
There would be performance differences anyway, since with directio we
would NOT be using the local pagecache to enhance client performance.

In any case, as Jeff mentioned, what they are seeing is really a different
issue than what the case was originally opened on (and which a fix has been
committed for), so Jeff will need a separate BZ to be filed for this
different problem.  This will also mean we need a separate Issue Tracker.



Thanks,
Vince



Internal Status set to 'Waiting on Support'

This event sent from IssueTracker by vincew 
 issue 134794

Comment 34 Issue Tracker 2008-02-06 19:40:06 UTC
Navid,

Actually we need to focus a little closer on what the firefox strace log
is really telling us.  I'm going to quote some lines from the firefox
strace file and cite line numbers for purpose of reference below:

lines 76700 - 76703:
6527  open("/mnt/cifs/foo.dat", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE,
0600) = 38
6527  open("/tmp/ft3un2ku.bin", O_RDONLY|O_LARGEFILE) = 39
6527  read(39,
"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"...,
8192) = 8192
6527  write(38,
"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"...,
8192) = 8192

After doing some initial "setup", firefox open()'s /mnt/cifs/foo.dat
(the DESTINATION file on the CIFS mount) for WRITING, and gets file
descriptor 38 returned from the open() call.

Firefox then open()'s /tmp/ft3un2ku.bin (the SOURCE file) for READING,
and gets file descriptor 39 back for this open() call.

With both files open, it begins reading from fd 39 (the source file) in 8K
buffer sizes, and writing the buffer out to fd38 (the destination on CIFS),
until it hits EOF on the source file:


lines 79517 - 79523
6527  read(39,
"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"...,
8192) = 8192
6527  write(38,
"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"...,
8192) = 8192
6527  read(39, "", 8192)                = 0
6527  close(38 <unfinished ...>
6531  <... futex resumed> )             = -1 ETIMEDOUT (Connection timed
out)
6531  gettimeofday({1201511323, 406093}, NULL) = 0
6531  futex(0x8b9f340, FUTEX_WAKE, 1)   = 0

Above, we have finished reading the source file (EOF returned from the
read() call on fd39), so there is nothing more to read and therefore
nothing more to write to the destination file on fd38.  So we call close()
on fd 38 - the destination file on the CIFS mount.  We then begin a series
of futex/gettimeofday waits until our close() call on the destination file
descriptor returns.  However, we do not get a normal return from the close
of our destination file descriptor - we get a -1 ENOSPC error returned TO
FIREFOX instead:

lines 79545 - 79549
6527  <... close resumed> )             = -1 ENOSPC (No space left on
device)
6527  close(39)                         = 0
6527  lstat64("/tmp/ft3un2ku.bin", {st_mode=S_IFREG|0600,
st_size=11534336, ...}) = 0
6527  unlink("/tmp/ft3un2ku.bin")       = 0
6527  chmod("/mnt/cifs/foo.dat", 0644)  = 0

Firefox fails to see (check for) an error return on the close and proceeds
to close the source file's file descriptor (fd39).  Note that a 0 return
code from the close() on the SOURCE file is completely normal and expected
behavior since all we needed to do was READ from this file.

However, we DID get an error returned to Firefox when we tried to close()
the destination file (the file we wanted to write to the CIFS mount) - but
Firefox ignored the error and went on about its business as if the file was
written successfully.

So this is a Firefox problem, and a separate case should be opened against
Firefox for failing to properly check for (and/or handle) errors returned
from close() calls.  Jeff suggests that if they are going to fix Firefox
to check the return value on close(), they should also make it do an
fsync() beforehand and check that return value as well.

Hopefully it is understood now that the problem here is Firefox, *NOT*
CIFS.  As such, there is not much more to be done here.

Thank you,
Vince

Internal Status set to 'Waiting on Support'

This event sent from IssueTracker by vincew 
 issue 134794

Comment 35 Issue Tracker 2008-02-28 22:55:04 UTC
Please refer them the write(2) man page, NOTES section at the bottom, to
answer their question.  The behavior is by design and a direct result of
using the system page cache.  It also discusses using fsync() calls as a
way to ensure data is actually being written.  This will be something to
perhaps mention in the ticket opened to request firefox be fixed to
actually check for errors when close() is called.

--vince


This event sent from IssueTracker by vincew 
 issue 134794

Comment 38 errata-xmlrpc 2008-05-21 15:03:21 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0314.html


Comment 39 Jeff Layton 2011-05-25 11:20:52 UTC
*** Bug 705693 has been marked as a duplicate of this bug. ***