Commit b0966a09 authored by Pavel Shilovsky's avatar Pavel Shilovsky

Update 3.9 sources from stable (v3.9.11)

parent 1c85a8c0
......@@ -327,14 +327,14 @@ UniToupper(register wchar_t uc)
/*
* UniStrupr: Upper case a unicode string
*/
static inline wchar_t *
UniStrupr(register wchar_t *upin)
static inline __le16 *
UniStrupr(register __le16 *upin)
{
register wchar_t *up;
register __le16 *up;
up = upin;
while (*up) { /* For all characters */
*up = UniToupper(*up);
*up = cpu_to_le16(UniToupper(le16_to_cpu(*up)));
up++;
}
return upin; /* Return input pointer */
......
......@@ -415,7 +415,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
int rc = 0;
int len;
char nt_hash[CIFS_NTHASH_SIZE];
wchar_t *user;
__le16 *user;
wchar_t *domain;
wchar_t *server;
......@@ -440,7 +440,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
return rc;
}
/* convert ses->user_name to unicode and uppercase */
/* convert ses->user_name to unicode */
len = ses->user_name ? strlen(ses->user_name) : 0;
user = kmalloc(2 + (len * 2), GFP_KERNEL);
if (user == NULL) {
......@@ -450,7 +450,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
}
if (len) {
len = cifs_strtoUTF16((__le16 *)user, ses->user_name, len, nls_cp);
len = cifs_strtoUTF16(user, ses->user_name, len, nls_cp);
UniStrupr(user);
} else {
memset(user, '\0', 2);
......
......@@ -560,11 +560,10 @@ cifs_relock_file(struct cifsFileInfo *cfile)
struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
int rc = 0;
/* we are going to update can_cache_brlcks here - need a write access */
down_write(&cinode->lock_sem);
down_read(&cinode->lock_sem);
if (cinode->can_cache_brlcks) {
/* can cache locks - no need to push them */
up_write(&cinode->lock_sem);
/* can cache locks - no need to relock */
up_read(&cinode->lock_sem);
return rc;
}
......@@ -575,7 +574,7 @@ cifs_relock_file(struct cifsFileInfo *cfile)
else
rc = tcon->ses->server->ops->push_mand_locks(cfile);
up_write(&cinode->lock_sem);
up_read(&cinode->lock_sem);
return rc;
}
......
......@@ -556,6 +556,11 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
fattr->cf_mode &= ~(S_IWUGO);
fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
if (fattr->cf_nlink < 1) {
cFYI(1, "replacing bogus file nlink value %u\n",
fattr->cf_nlink);
fattr->cf_nlink = 1;
}
}
fattr->cf_uid = cifs_sb->mnt_uid;
......
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