Commit 4846546f authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] pSesInfo->sesSem is used as mutex. Rename it to session_mutex and
  [CIFS] Use unsigned ea length for clarity
  cifs: set server_eof in cifs_fattr_to_inode
  [CIFS] Minor cleanup to EA patch
  cifs: merge CIFSSMBQueryEA with CIFSSMBQAllEAs
  cifs: verify lengths of QueryAllEAs reply
  cifs: increase maximum buffer size in CIFSSMBQAllEAs
  cifs: rename name_len to list_len in CIFSSMBQAllEAs
  cifs: clean up indentation in CIFSSMBQAllEAs
  cifs: add parens around smb_var in BCC macros
parents 832d30ca d7b619cf
Version 1.62 Version 1.62
------------ ------------
Add sockopt=TCP_NODELAY mount option. Add sockopt=TCP_NODELAY mount option. EA (xattr) routines hardened
to more strictly handle corrupt frames.
Version 1.61 Version 1.61
------------ ------------
......
...@@ -205,7 +205,7 @@ struct cifsUidInfo { ...@@ -205,7 +205,7 @@ struct cifsUidInfo {
struct cifsSesInfo { struct cifsSesInfo {
struct list_head smb_ses_list; struct list_head smb_ses_list;
struct list_head tcon_list; struct list_head tcon_list;
struct semaphore sesSem; struct mutex session_mutex;
#if 0 #if 0
struct cifsUidInfo *uidInfo; /* pointer to user info */ struct cifsUidInfo *uidInfo; /* pointer to user info */
#endif #endif
......
...@@ -415,10 +415,10 @@ struct smb_hdr { ...@@ -415,10 +415,10 @@ struct smb_hdr {
__u8 WordCount; __u8 WordCount;
} __attribute__((packed)); } __attribute__((packed));
/* given a pointer to an smb_hdr retrieve the value of byte count */ /* given a pointer to an smb_hdr retrieve the value of byte count */
#define BCC(smb_var) (*(__u16 *)((char *)smb_var + sizeof(struct smb_hdr) + (2 * smb_var->WordCount))) #define BCC(smb_var) (*(__u16 *)((char *)(smb_var) + sizeof(struct smb_hdr) + (2 * (smb_var)->WordCount)))
#define BCC_LE(smb_var) (*(__le16 *)((char *)smb_var + sizeof(struct smb_hdr) + (2 * smb_var->WordCount))) #define BCC_LE(smb_var) (*(__le16 *)((char *)(smb_var) + sizeof(struct smb_hdr) + (2 * (smb_var)->WordCount)))
/* given a pointer to an smb_hdr retrieve the pointer to the byte area */ /* given a pointer to an smb_hdr retrieve the pointer to the byte area */
#define pByteArea(smb_var) ((unsigned char *)smb_var + sizeof(struct smb_hdr) + (2 * smb_var->WordCount) + 2) #define pByteArea(smb_var) ((unsigned char *)(smb_var) + sizeof(struct smb_hdr) + (2 * (smb_var)->WordCount) + 2)
/* /*
* Computer Name Length (since Netbios name was length 16 with last byte 0x20) * Computer Name Length (since Netbios name was length 16 with last byte 0x20)
......
...@@ -363,13 +363,10 @@ extern int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon, ...@@ -363,13 +363,10 @@ extern int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon,
__u32 filter, struct file *file, int multishot, __u32 filter, struct file *file, int multishot,
const struct nls_table *nls_codepage); const struct nls_table *nls_codepage);
extern ssize_t CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon, extern ssize_t CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon,
const unsigned char *searchName, char *EAData, const unsigned char *searchName,
const unsigned char *ea_name, char *EAData,
size_t bufsize, const struct nls_table *nls_codepage, size_t bufsize, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern ssize_t CIFSSMBQueryEA(const int xid, struct cifsTconInfo *tcon,
const unsigned char *searchName, const unsigned char *ea_name,
unsigned char *ea_value, size_t buf_size,
const struct nls_table *nls_codepage, int remap_special_chars);
extern int CIFSSMBSetEA(const int xid, struct cifsTconInfo *tcon, extern int CIFSSMBSetEA(const int xid, struct cifsTconInfo *tcon,
const char *fileName, const char *ea_name, const char *fileName, const char *ea_name,
const void *ea_value, const __u16 ea_value_len, const void *ea_value, const __u16 ea_value_len,
......
This diff is collapsed.
...@@ -2388,13 +2388,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, ...@@ -2388,13 +2388,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
*/ */
cifs_put_tcp_session(srvTcp); cifs_put_tcp_session(srvTcp);
down(&pSesInfo->sesSem); mutex_lock(&pSesInfo->session_mutex);
if (pSesInfo->need_reconnect) { if (pSesInfo->need_reconnect) {
cFYI(1, ("Session needs reconnect")); cFYI(1, ("Session needs reconnect"));
rc = cifs_setup_session(xid, pSesInfo, rc = cifs_setup_session(xid, pSesInfo,
cifs_sb->local_nls); cifs_sb->local_nls);
} }
up(&pSesInfo->sesSem); mutex_unlock(&pSesInfo->session_mutex);
} else if (!rc) { } else if (!rc) {
cFYI(1, ("Existing smb sess not found")); cFYI(1, ("Existing smb sess not found"));
pSesInfo = sesInfoAlloc(); pSesInfo = sesInfoAlloc();
...@@ -2437,12 +2437,12 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, ...@@ -2437,12 +2437,12 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
} }
pSesInfo->linux_uid = volume_info->linux_uid; pSesInfo->linux_uid = volume_info->linux_uid;
pSesInfo->overrideSecFlg = volume_info->secFlg; pSesInfo->overrideSecFlg = volume_info->secFlg;
down(&pSesInfo->sesSem); mutex_lock(&pSesInfo->session_mutex);
/* BB FIXME need to pass vol->secFlgs BB */ /* BB FIXME need to pass vol->secFlgs BB */
rc = cifs_setup_session(xid, pSesInfo, rc = cifs_setup_session(xid, pSesInfo,
cifs_sb->local_nls); cifs_sb->local_nls);
up(&pSesInfo->sesSem); mutex_unlock(&pSesInfo->session_mutex);
} }
/* search for existing tcon to this server share */ /* search for existing tcon to this server share */
......
...@@ -111,6 +111,7 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) ...@@ -111,6 +111,7 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr)
cifs_i->delete_pending = fattr->cf_flags & CIFS_FATTR_DELETE_PENDING; cifs_i->delete_pending = fattr->cf_flags & CIFS_FATTR_DELETE_PENDING;
cifs_i->server_eof = fattr->cf_eof;
/* /*
* Can't safely change the file size here if the client is writing to * Can't safely change the file size here if the client is writing to
* it due to potential races. * it due to potential races.
...@@ -366,7 +367,7 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path, ...@@ -366,7 +367,7 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
char ea_value[4]; char ea_value[4];
__u32 mode; __u32 mode;
rc = CIFSSMBQueryEA(xid, cifs_sb->tcon, path, "SETFILEBITS", rc = CIFSSMBQAllEAs(xid, cifs_sb->tcon, path, "SETFILEBITS",
ea_value, 4 /* size of buf */, cifs_sb->local_nls, ea_value, 4 /* size of buf */, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
......
...@@ -79,7 +79,7 @@ sesInfoAlloc(void) ...@@ -79,7 +79,7 @@ sesInfoAlloc(void)
++ret_buf->ses_count; ++ret_buf->ses_count;
INIT_LIST_HEAD(&ret_buf->smb_ses_list); INIT_LIST_HEAD(&ret_buf->smb_ses_list);
INIT_LIST_HEAD(&ret_buf->tcon_list); INIT_LIST_HEAD(&ret_buf->tcon_list);
init_MUTEX(&ret_buf->sesSem); mutex_init(&ret_buf->session_mutex);
} }
return ret_buf; return ret_buf;
} }
......
...@@ -244,7 +244,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, ...@@ -244,7 +244,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
/* revalidate/getattr then populate from inode */ /* revalidate/getattr then populate from inode */
} /* BB add else when above is implemented */ } /* BB add else when above is implemented */
ea_name += 5; /* skip past user. prefix */ ea_name += 5; /* skip past user. prefix */
rc = CIFSSMBQueryEA(xid, pTcon, full_path, ea_name, ea_value, rc = CIFSSMBQAllEAs(xid, pTcon, full_path, ea_name, ea_value,
buf_size, cifs_sb->local_nls, buf_size, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
} else if (strncmp(ea_name, CIFS_XATTR_OS2_PREFIX, 4) == 0) { } else if (strncmp(ea_name, CIFS_XATTR_OS2_PREFIX, 4) == 0) {
...@@ -252,7 +252,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, ...@@ -252,7 +252,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
goto get_ea_exit; goto get_ea_exit;
ea_name += 4; /* skip past os2. prefix */ ea_name += 4; /* skip past os2. prefix */
rc = CIFSSMBQueryEA(xid, pTcon, full_path, ea_name, ea_value, rc = CIFSSMBQAllEAs(xid, pTcon, full_path, ea_name, ea_value,
buf_size, cifs_sb->local_nls, buf_size, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
} else if (strncmp(ea_name, POSIX_ACL_XATTR_ACCESS, } else if (strncmp(ea_name, POSIX_ACL_XATTR_ACCESS,
...@@ -364,8 +364,8 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size) ...@@ -364,8 +364,8 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
/* if proc/fs/cifs/streamstoxattr is set then /* if proc/fs/cifs/streamstoxattr is set then
search server for EAs or streams to search server for EAs or streams to
returns as xattrs */ returns as xattrs */
rc = CIFSSMBQAllEAs(xid, pTcon, full_path, data, buf_size, rc = CIFSSMBQAllEAs(xid, pTcon, full_path, NULL, data,
cifs_sb->local_nls, buf_size, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment