Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Pull CIFS fixes from Steve French: "Three cifs/smb3 fixes - including two for stable" * 'for-next' of git://git.samba.org/sfrench/cifs-2.6: cifs: don't check for failure from mempool_alloc() Do not return number of bytes written for ioctl CIFS_IOC_COPYCHUNK_FILE Fix match_prepath()
This commit is contained in:
commit
6fd4e7f774
@ -2912,16 +2912,14 @@ match_prepath(struct super_block *sb, struct cifs_mnt_data *mnt_data)
|
|||||||
{
|
{
|
||||||
struct cifs_sb_info *old = CIFS_SB(sb);
|
struct cifs_sb_info *old = CIFS_SB(sb);
|
||||||
struct cifs_sb_info *new = mnt_data->cifs_sb;
|
struct cifs_sb_info *new = mnt_data->cifs_sb;
|
||||||
|
bool old_set = old->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH;
|
||||||
|
bool new_set = new->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH;
|
||||||
|
|
||||||
if (old->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH) {
|
if (old_set && new_set && !strcmp(new->prepath, old->prepath))
|
||||||
if (!(new->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH))
|
|
||||||
return 0;
|
|
||||||
/* The prepath should be null terminated strings */
|
|
||||||
if (strcmp(new->prepath, old->prepath))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
else if (!old_set && !new_set)
|
||||||
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,8 @@ static long cifs_ioctl_copychunk(unsigned int xid, struct file *dst_file,
|
|||||||
|
|
||||||
rc = cifs_file_copychunk_range(xid, src_file.file, 0, dst_file, 0,
|
rc = cifs_file_copychunk_range(xid, src_file.file, 0, dst_file, 0,
|
||||||
src_inode->i_size, 0);
|
src_inode->i_size, 0);
|
||||||
|
if (rc > 0)
|
||||||
|
rc = 0;
|
||||||
out_fput:
|
out_fput:
|
||||||
fdput(src_file);
|
fdput(src_file);
|
||||||
out_drop_write:
|
out_drop_write:
|
||||||
|
@ -167,13 +167,11 @@ cifs_buf_get(void)
|
|||||||
|
|
||||||
/* clear the first few header bytes */
|
/* clear the first few header bytes */
|
||||||
/* for most paths, more is cleared in header_assemble */
|
/* for most paths, more is cleared in header_assemble */
|
||||||
if (ret_buf) {
|
|
||||||
memset(ret_buf, 0, buf_size + 3);
|
memset(ret_buf, 0, buf_size + 3);
|
||||||
atomic_inc(&bufAllocCount);
|
atomic_inc(&bufAllocCount);
|
||||||
#ifdef CONFIG_CIFS_STATS2
|
#ifdef CONFIG_CIFS_STATS2
|
||||||
atomic_inc(&totBufAllocCount);
|
atomic_inc(&totBufAllocCount);
|
||||||
#endif /* CONFIG_CIFS_STATS2 */
|
#endif /* CONFIG_CIFS_STATS2 */
|
||||||
}
|
|
||||||
|
|
||||||
return ret_buf;
|
return ret_buf;
|
||||||
}
|
}
|
||||||
@ -201,7 +199,6 @@ cifs_small_buf_get(void)
|
|||||||
albeit slightly larger than necessary and maxbuffersize
|
albeit slightly larger than necessary and maxbuffersize
|
||||||
defaults to this and can not be bigger */
|
defaults to this and can not be bigger */
|
||||||
ret_buf = mempool_alloc(cifs_sm_req_poolp, GFP_NOFS);
|
ret_buf = mempool_alloc(cifs_sm_req_poolp, GFP_NOFS);
|
||||||
if (ret_buf) {
|
|
||||||
/* No need to clear memory here, cleared in header assemble */
|
/* No need to clear memory here, cleared in header assemble */
|
||||||
/* memset(ret_buf, 0, sizeof(struct smb_hdr) + 27);*/
|
/* memset(ret_buf, 0, sizeof(struct smb_hdr) + 27);*/
|
||||||
atomic_inc(&smBufAllocCount);
|
atomic_inc(&smBufAllocCount);
|
||||||
@ -209,7 +206,6 @@ cifs_small_buf_get(void)
|
|||||||
atomic_inc(&totSmBufAllocCount);
|
atomic_inc(&totSmBufAllocCount);
|
||||||
#endif /* CONFIG_CIFS_STATS2 */
|
#endif /* CONFIG_CIFS_STATS2 */
|
||||||
|
|
||||||
}
|
|
||||||
return ret_buf;
|
return ret_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -538,9 +538,6 @@ smb2_mid_entry_alloc(const struct smb2_sync_hdr *shdr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
temp = mempool_alloc(cifs_mid_poolp, GFP_NOFS);
|
temp = mempool_alloc(cifs_mid_poolp, GFP_NOFS);
|
||||||
if (temp == NULL)
|
|
||||||
return temp;
|
|
||||||
else {
|
|
||||||
memset(temp, 0, sizeof(struct mid_q_entry));
|
memset(temp, 0, sizeof(struct mid_q_entry));
|
||||||
temp->mid = le64_to_cpu(shdr->MessageId);
|
temp->mid = le64_to_cpu(shdr->MessageId);
|
||||||
temp->pid = current->pid;
|
temp->pid = current->pid;
|
||||||
@ -554,7 +551,6 @@ smb2_mid_entry_alloc(const struct smb2_sync_hdr *shdr,
|
|||||||
*/
|
*/
|
||||||
temp->callback = cifs_wake_up_task;
|
temp->callback = cifs_wake_up_task;
|
||||||
temp->callback_data = current;
|
temp->callback_data = current;
|
||||||
}
|
|
||||||
|
|
||||||
atomic_inc(&midCount);
|
atomic_inc(&midCount);
|
||||||
temp->mid_state = MID_REQUEST_ALLOCATED;
|
temp->mid_state = MID_REQUEST_ALLOCATED;
|
||||||
|
@ -55,9 +55,6 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)
|
|||||||
}
|
}
|
||||||
|
|
||||||
temp = mempool_alloc(cifs_mid_poolp, GFP_NOFS);
|
temp = mempool_alloc(cifs_mid_poolp, GFP_NOFS);
|
||||||
if (temp == NULL)
|
|
||||||
return temp;
|
|
||||||
else {
|
|
||||||
memset(temp, 0, sizeof(struct mid_q_entry));
|
memset(temp, 0, sizeof(struct mid_q_entry));
|
||||||
temp->mid = get_mid(smb_buffer);
|
temp->mid = get_mid(smb_buffer);
|
||||||
temp->pid = current->pid;
|
temp->pid = current->pid;
|
||||||
@ -74,7 +71,6 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)
|
|||||||
*/
|
*/
|
||||||
temp->callback = cifs_wake_up_task;
|
temp->callback = cifs_wake_up_task;
|
||||||
temp->callback_data = current;
|
temp->callback_data = current;
|
||||||
}
|
|
||||||
|
|
||||||
atomic_inc(&midCount);
|
atomic_inc(&midCount);
|
||||||
temp->mid_state = MID_REQUEST_ALLOCATED;
|
temp->mid_state = MID_REQUEST_ALLOCATED;
|
||||||
|
Loading…
Reference in New Issue
Block a user