[CIFS] work around bug in Samba server handling for posix open

Previous thread: [CIFS] Use posix open on file open when server supports it by Linux Kernel Mailing List on Thursday, March 26, 2009 - 4:59 pm. (1 message)

Next thread: [CIFS] add extra null attr check by Linux Kernel Mailing List on Thursday, March 26, 2009 - 4:59 pm. (1 message)
From: Linux Kernel Mailing List
Date: Thursday, March 26, 2009 - 4:59 pm

Gitweb:     http://git.kernel.org/linus/64cc2c63694a03393985ffc8b178e72f52dd8a06
Commit:     64cc2c63694a03393985ffc8b178e72f52dd8a06
Parent:     276a74a4835ad86d6da42f3a084b060afc5656e8
Author:     Steve French <sfrench@us.ibm.com>
AuthorDate: Wed Mar 4 19:54:08 2009 +0000
Committer:  Steve French <sfrench@us.ibm.com>
CommitDate: Thu Mar 12 01:36:21 2009 +0000

    [CIFS] work around bug in Samba server handling for posix open
    
    Samba server (version 3.3.1 and earlier, and 3.2.8 and earlier) incorrectly
    required the O_CREAT flag on posix open (even when a file was not being
    created).  This disables posix open (create is still ok) after the first
    attempt returns EINVAL (and logs an error, once, recommending that they
    update their server).
    
    Acked-by: Jeff Layton <jlayton@redhat.com>
    Signed-off-by: Steve French <sfrench@us.ibm.com>
---
 fs/cifs/CHANGES    |    2 ++
 fs/cifs/cifsglob.h |    1 +
 fs/cifs/file.c     |   16 +++++++++++++---
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index b33c841..fc977df 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -11,6 +11,8 @@ to better ensure that we wait for server to write all of the data to
 server disk (not just write it over the network).  Add new mount
 parameter to allow user to disable sending the (slow) SMB flush on
 fsync if desired (fsync still flushes all cached write data to the server).
+Posix file open support added (turned off after one attempt if server
+fails to support it properly, as with Samba server versions prior to 3.3.2)
 
 Version 1.56
 ------------
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 44ff94d..9fbf4df 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -299,6 +299,7 @@ struct cifsTconInfo {
 	bool unix_ext:1;  /* if false disable Linux extensions to CIFS protocol
 				for this mount even if server would support */
 	bool local_lease:1; /* check leases (only) on local system not ...
Previous thread: [CIFS] Use posix open on file open when server supports it by Linux Kernel Mailing List on Thursday, March 26, 2009 - 4:59 pm. (1 message)

Next thread: [CIFS] add extra null attr check by Linux Kernel Mailing List on Thursday, March 26, 2009 - 4:59 pm. (1 message)