Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133616
b: refs/heads/master
c: 64cc2c6
h: refs/heads/master
v: v3
  • Loading branch information
Steve French committed Mar 12, 2009
1 parent efdac6e commit 4208805
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 276a74a4835ad86d6da42f3a084b060afc5656e8
refs/heads/master: 64cc2c63694a03393985ffc8b178e72f52dd8a06
2 changes: 2 additions & 0 deletions trunk/fs/cifs/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/cifs/cifsglob.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 remote */
bool broken_posix_open; /* e.g. Samba server versions < 3.3.2, 3.2.9 */
bool need_reconnect:1; /* connection reset, tid now invalid */
/* BB add field for back pointer to sb struct(s)? */
};
Expand Down
16 changes: 13 additions & 3 deletions trunk/fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ int cifs_open(struct inode *inode, struct file *file)
else
oplock = 0;

if (tcon->unix_ext && (tcon->ses->capabilities & CAP_UNIX) &&
if (!tcon->broken_posix_open && tcon->unix_ext &&
(tcon->ses->capabilities & CAP_UNIX) &&
(CIFS_UNIX_POSIX_PATH_OPS_CAP &
le64_to_cpu(tcon->fsUnixInfo.Capability))) {
int oflags = (int) cifs_posix_convert_flags(file->f_flags);
Expand All @@ -344,11 +345,20 @@ int cifs_open(struct inode *inode, struct file *file)
cifs_posix_open_inode_helper(inode, file, pCifsInode,
pCifsFile, oplock, netfid);
goto out;
} else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
if (tcon->ses->serverNOS)
cERROR(1, ("server %s of type %s returned"
" unexpected error on SMB posix open"
", disabling posix open support."
" Check if server update available.",
tcon->ses->serverName,
tcon->ses->serverNOS));
tcon->broken_posix_open = true;
} else if ((rc != -EIO) && (rc != -EREMOTE) &&
(rc != -EOPNOTSUPP)) /* path not found or net err */
goto out;
/* fallthrough to retry open the old way on operation
not supported or DFS errors */
/* else fallthrough to retry open the old way on network i/o
or DFS errors */
}

desiredAccess = cifs_convert_flags(file->f_flags);
Expand Down

0 comments on commit 4208805

Please sign in to comment.