cifs fixes
Linus,
Please pull from:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git/HEAD
This will update the following files:
cifs/README | 4 +-- cifs/cifsproto.h | 2 - cifs/cifssmb.c | 56 +++++++++++++++++++++++++++---------------------------- cifs/dir.c | 3 +- cifs/inode.c | 24 ++++++++++++++--------- cifs/misc.c | 1 6 files changed, 49 insertions(+), 41 deletions(-)
commit b1a45695bde0204597957e448923f09ce271ca80
tree 96e82946fffd1105741dc99c886d92753ddac0ee
parent b2aeb9d565be5ef00fb9f921c6d2459c74d90cdf
author Steve French <stevef@stevef95> Tue, 17 May 2005 16:07:23 -0500 committer Steve French <stevef@stevef95> Tue, 17 May 2005 16:07:23 -0500
[CIFS] fix casts of unicode strings to match function definition
commit b2aeb9d565be5ef00fb9f921c6d2459c74d90cdf
tree e7adab50ce6a13ef5ceb0fbb3d1208ae63523dc9
parent 67594feb4b68074d8807f5566536e06db9130679
author Steve French <stevef@stevef95> Tue, 17 May 2005 13:16:18 -0500 committer Steve French <stevef@stevef95> Tue, 17 May 2005 13:16:18 -0500
[CIFS] Fix oops in cifs_unlink. Caused in some cases when renaming
over existing,
newly created, file.
Samba bugzilla: 2697
commit 67594feb4b68074d8807f5566536e06db9130679
tree 7360879062daf210285ab0a72be22eb26c2565e3
parent ff0d2f90fdc4b564d47a7c26b16de81a16cfa28e
author Steve French <stevef@stevef95> Tue, 17 May 2005 13:04:49 -0500 committer Steve French <stevef@stevef95> Tue, 17 May 2005 13:04:49 -0500
[CIFS] missing break needed to handle < when mount option "mapchars"
specified
The diff also is attached
fs/cifs/README (mode:100644) +2 -2
@@ -371,7 +371,7 @@ on newly created files, directories, and devices (create, mkdir, mknod) which will result in the server setting the uid and gid to the default (usually the server uid of the - usern who mounted the share). Letting the server (rather than + user who mounted the share). Letting the server (rather than the client) set the uid and gid is the default. This parameter has no effect if the CIFS Unix Extensions are not negotiated.
@@ -384,7 +384,7 @@ client (e.g. when the application is doing large sequential reads bigger than page size without rereading the same data) this can provide better performance than the default - behavior which caches reads (reaadahead) and writes + behavior which caches reads (readahead) and writes (writebehind) through the local Linux client pagecache if oplock (caching token) is granted and held. Note that direct allows write operations larger than page size
fs/cifs/cifsproto.h (mode:100644) +1 -1
@@ -228,7 +228,7 @@ const struct nls_table *nls_codepage, int remap_special_chars); #endif /* CONFIG_CIFS_EXPERIMENTAL */ -extern int cifs_convertUCSpath(char *target, const __u16 *source, int maxlen, +extern int cifs_convertUCSpath(char *target, const __le16 *source, int maxlen, const struct nls_table * codepage); extern int cifsConvertToUCS(__le16 * target, const char *source, int maxlen, const struct nls_table * cp, int mapChars);
fs/cifs/cifssmb.c (mode:100644) +28 -28
220 lines not on this page · raw message
fs/cifs/dir.c (mode:100644) +2 -1
@@ -392,7 +392,8 @@ rc = 0; d_add(direntry, NULL); } else { - cERROR(1,("Error 0x%x or on cifs_get_inode_info in lookup",rc)); + cERROR(1,("Error 0x%x on cifs_get_inode_info in lookup of %s", + rc,full_path)); /* BB special case check for Access Denied - watch security exposure of returning dir info implicitly via different rc if file exists or not but no access BB */
fs/cifs/inode.c (mode:100644) +15 -9
@@ -422,7 +422,8 @@ cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); if (!rc) { - direntry->d_inode->i_nlink--; + if(direntry->d_inode) + direntry->d_inode->i_nlink--; } else if (rc == -ENOENT) { d_drop(direntry); } else if (rc == -ETXTBSY) {
@@ -440,7 +441,8 @@ cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); CIFSSMBClose(xid, pTcon, netfid); - direntry->d_inode->i_nlink--; + if(direntry->d_inode) + direntry->d_inode->i_nlink--; } } else if (rc == -EACCES) { /* try only if r/o attribute set in local lookup data? */
@@ -494,7 +496,8 @@ cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); if (!rc) { - direntry->d_inode->i_nlink--; + if(direntry->d_inode) + direntry->d_inode->i_nlink--; } else if (rc == -ETXTBSY) { int oplock = FALSE; __u16 netfid;
@@ -514,17 +517,20 @@ cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); CIFSSMBClose(xid, pTcon, netfid); - direntry->d_inode->i_nlink--; + if(direntry->d_inode) + direntry->d_inode->i_nlink--; } /* BB if rc = -ETXTBUSY goto the rename logic BB */ } } } - cifsInode = CIFS_I(direntry->d_inode); - cifsInode->time = 0; /* will force revalidate to get info when - needed */ - direntry->d_inode->i_ctime = inode->i_ctime = inode->i_mtime = - current_fs_time(inode->i_sb); + if(direntry->d_inode) { + cifsInode = CIFS_I(direntry->d_inode); + cifsInode->time = 0; /* will force revalidate to get info + when needed */ + direntry->d_inode->i_ctime = current_fs_time(inode->i_sb); + } + inode->i_ctime = inode->i_mtime = current_fs_time(inode->i_sb); cifsInode = CIFS_I(inode); cifsInode->time = 0; /* force revalidate of dir as well */
fs/cifs/misc.c (mode:100644) +1 -0
@@ -571,6 +571,7 @@ break; case UNI_LESSTHAN: target[j] = '<'; + break; default: len = cp->uni2char(src_char, &target[j], NLS_MAX_CHARSET_SIZE);