Commit 6acef63e authored by Pavel Shilovsky's avatar Pavel Shilovsky

Update 3.2 sources from stable (v3.2.59)

parent 140591c0
......@@ -3444,11 +3444,13 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL,
return 0;
}
cifs_acl->version = cpu_to_le16(1);
if (acl_type == ACL_TYPE_ACCESS)
if (acl_type == ACL_TYPE_ACCESS) {
cifs_acl->access_entry_count = cpu_to_le16(count);
else if (acl_type == ACL_TYPE_DEFAULT)
cifs_acl->default_entry_count = __constant_cpu_to_le16(0xFFFF);
} else if (acl_type == ACL_TYPE_DEFAULT) {
cifs_acl->default_entry_count = cpu_to_le16(count);
else {
cifs_acl->access_entry_count = __constant_cpu_to_le16(0xFFFF);
} else {
cFYI(1, "unknown ACL type %d", acl_type);
return 0;
}
......
......@@ -1113,7 +1113,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
cERROR(1, "Krb5 cifs privacy not supported");
goto cifs_parse_mount_err;
} else if (strnicmp(value, "krb5", 4) == 0) {
vol->secFlg |= CIFSSEC_MAY_KRB5;
vol->secFlg |= CIFSSEC_MAY_KRB5 |
CIFSSEC_MAY_SIGN;
} else if (strnicmp(value, "ntlmsspi", 8) == 0) {
vol->secFlg |= CIFSSEC_MAY_NTLMSSP |
CIFSSEC_MUST_SIGN;
......
......@@ -2113,7 +2113,7 @@ cifs_iovec_write(struct file *file, const struct iovec *iov,
{
unsigned int written;
unsigned long num_pages, npages, i;
size_t copied, len, cur_len;
size_t bytes, copied, len, cur_len;
ssize_t total_written = 0;
struct kvec *to_send;
struct page **pages;
......@@ -2171,17 +2171,45 @@ cifs_iovec_write(struct file *file, const struct iovec *iov,
do {
size_t save_len = cur_len;
for (i = 0; i < npages; i++) {
copied = min_t(const size_t, cur_len, PAGE_CACHE_SIZE);
bytes = min_t(const size_t, cur_len, PAGE_CACHE_SIZE);
copied = iov_iter_copy_from_user(pages[i], &it, 0,
copied);
bytes);
cur_len -= copied;
iov_iter_advance(&it, copied);
to_send[i+1].iov_base = kmap(pages[i]);
to_send[i+1].iov_len = copied;
/*
* If we didn't copy as much as we expected, then that
* may mean we trod into an unmapped area. Stop copying
* at that point. On the next pass through the big
* loop, we'll likely end up getting a zero-length
* write and bailing out of it.
*/
if (copied < bytes)
break;
}
cur_len = save_len - cur_len;
/*
* If we have no data to send, then that probably means that
* the copy above failed altogether. That's most likely because
* the address in the iovec was bogus. Set the rc to -EFAULT,
* free anything we allocated and bail out.
*/
if (!cur_len) {
kunmap(pages[0]);
if (!total_written)
total_written = -EFAULT;
break;
}
/*
* i + 1 now represents the number of pages we actually used in
* the copy phase above.
*/
npages = min(npages, i + 1);
do {
if (open_file->invalidHandle) {
rc = cifs_reopen_file(open_file, false);
......
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