diff --git a/[refs] b/[refs] index 80681ecb0906..8aeaf0ef948a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fb2b2a1d37f80cc818fd4487b510f4e11816e5e1 +refs/heads/master: d344e38b2c151ca5e5e39f562017127e93912528 diff --git a/trunk/arch/x86/kernel/acpi/sleep.c b/trunk/arch/x86/kernel/acpi/sleep.c index 4d9ebbab2230..68d1537b8c81 100644 --- a/trunk/arch/x86/kernel/acpi/sleep.c +++ b/trunk/arch/x86/kernel/acpi/sleep.c @@ -12,10 +12,8 @@ #include #include #include - -#ifdef CONFIG_X86_32 #include -#endif +#include #include "realmode/wakeup.h" #include "sleep.h" @@ -149,6 +147,15 @@ void __init acpi_reserve_wakeup_memory(void) memblock_x86_reserve_range(mem, mem + WAKEUP_SIZE, "ACPI WAKEUP"); } +int __init acpi_configure_wakeup_memory(void) +{ + if (acpi_realmode) + set_memory_x(acpi_realmode, WAKEUP_SIZE >> PAGE_SHIFT); + + return 0; +} +arch_initcall(acpi_configure_wakeup_memory); + static int __init acpi_sleep_setup(char *str) { diff --git a/trunk/fs/cifs/cifsacl.c b/trunk/fs/cifs/cifsacl.c index beeebf194234..1e7636b145a8 100644 --- a/trunk/fs/cifs/cifsacl.c +++ b/trunk/fs/cifs/cifsacl.c @@ -372,10 +372,6 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl, ppace = kmalloc(num_aces * sizeof(struct cifs_ace *), GFP_KERNEL); - if (!ppace) { - cERROR(1, "DACL memory allocation error"); - return; - } for (i = 0; i < num_aces; ++i) { ppace[i] = (struct cifs_ace *) (acl_base + acl_size); diff --git a/trunk/fs/cifs/cifssmb.c b/trunk/fs/cifs/cifssmb.c index 904aa47e3515..46c66ed01af4 100644 --- a/trunk/fs/cifs/cifssmb.c +++ b/trunk/fs/cifs/cifssmb.c @@ -136,6 +136,9 @@ cifs_reconnect_tcon(struct cifsTconInfo *tcon, int smb_command) } } + if (ses->status == CifsExiting) + return -EIO; + /* * Give demultiplex thread up to 10 seconds to reconnect, should be * greater than cifs socket timeout which is 7 seconds @@ -153,7 +156,7 @@ cifs_reconnect_tcon(struct cifsTconInfo *tcon, int smb_command) * retrying until process is killed or server comes * back on-line */ - if (!tcon->retry) { + if (!tcon->retry || ses->status == CifsExiting) { cFYI(1, "gave up waiting on reconnect in smb_init"); return -EHOSTDOWN; } diff --git a/trunk/fs/cifs/connect.c b/trunk/fs/cifs/connect.c index 257b6d895e20..47d8ff623683 100644 --- a/trunk/fs/cifs/connect.c +++ b/trunk/fs/cifs/connect.c @@ -337,12 +337,8 @@ cifs_echo_request(struct work_struct *work) struct TCP_Server_Info *server = container_of(work, struct TCP_Server_Info, echo.work); - /* - * We cannot send an echo until the NEGOTIATE_PROTOCOL request is done. - * Also, no need to ping if we got a response recently - */ - if (server->tcpStatus != CifsGood || - time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ)) + /* no need to ping if we got a response recently */ + if (time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ)) goto requeue_echo; rc = CIFSSMBEcho(server); @@ -582,12 +578,12 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server) else if (reconnect == 1) continue; - total_read += 4; /* account for rfc1002 hdr */ + length += 4; /* account for rfc1002 hdr */ - dump_smb(smb_buffer, total_read); - if (checkSMB(smb_buffer, smb_buffer->Mid, total_read)) { - cifs_dump_mem("Bad SMB: ", smb_buffer, - total_read < 48 ? total_read : 48); + + dump_smb(smb_buffer, length); + if (checkSMB(smb_buffer, smb_buffer->Mid, total_read+4)) { + cifs_dump_mem("Bad SMB: ", smb_buffer, 48); continue; } @@ -637,11 +633,11 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server) mid_entry->largeBuf = isLargeBuf; multi_t2_fnd: mid_entry->midState = MID_RESPONSE_RECEIVED; + list_del_init(&mid_entry->qhead); + mid_entry->callback(mid_entry); #ifdef CONFIG_CIFS_STATS2 mid_entry->when_received = jiffies; #endif - list_del_init(&mid_entry->qhead); - mid_entry->callback(mid_entry); break; } mid_entry = NULL; diff --git a/trunk/fs/cifs/file.c b/trunk/fs/cifs/file.c index e964b1cd5dd0..74c0a282d012 100644 --- a/trunk/fs/cifs/file.c +++ b/trunk/fs/cifs/file.c @@ -1662,10 +1662,10 @@ static ssize_t cifs_iovec_write(struct file *file, const struct iovec *iov, unsigned long nr_segs, loff_t *poffset) { - unsigned int written; - unsigned long num_pages, npages, i; - size_t copied, len, cur_len; - ssize_t total_written = 0; + size_t total_written = 0; + unsigned int written = 0; + unsigned long num_pages, npages; + size_t copied, len, cur_len, i; struct kvec *to_send; struct page **pages; struct iov_iter it; @@ -1821,8 +1821,7 @@ cifs_iovec_read(struct file *file, const struct iovec *iov, { int rc; int xid; - ssize_t total_read; - unsigned int bytes_read = 0; + unsigned int total_read, bytes_read = 0; size_t len, cur_len; int iov_offset = 0; struct cifs_sb_info *cifs_sb; diff --git a/trunk/fs/cifs/transport.c b/trunk/fs/cifs/transport.c index fbc5aace54b1..b8c5e2eb43d0 100644 --- a/trunk/fs/cifs/transport.c +++ b/trunk/fs/cifs/transport.c @@ -359,10 +359,6 @@ cifs_call_async(struct TCP_Server_Info *server, struct smb_hdr *in_buf, if (rc) return rc; - /* enable signing if server requires it */ - if (server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) - in_buf->Flags2 |= SMBFLG2_SECURITY_SIGNATURE; - mutex_lock(&server->srv_mutex); mid = AllocMidQEntry(in_buf, server); if (mid == NULL) { diff --git a/trunk/kernel/cred.c b/trunk/kernel/cred.c index 3a9d6dd53a6c..6a1aa004e376 100644 --- a/trunk/kernel/cred.c +++ b/trunk/kernel/cred.c @@ -252,13 +252,13 @@ struct cred *cred_alloc_blank(void) #endif atomic_set(&new->usage, 1); -#ifdef CONFIG_DEBUG_CREDENTIALS - new->magic = CRED_MAGIC; -#endif if (security_cred_alloc_blank(new, GFP_KERNEL) < 0) goto error; +#ifdef CONFIG_DEBUG_CREDENTIALS + new->magic = CRED_MAGIC; +#endif return new; error: @@ -657,8 +657,6 @@ struct cred *prepare_kernel_cred(struct task_struct *daemon) validate_creds(old); *new = *old; - atomic_set(&new->usage, 1); - set_cred_subscribers(new, 0); get_uid(new->user); get_group_info(new->group_info); @@ -676,6 +674,8 @@ struct cred *prepare_kernel_cred(struct task_struct *daemon) if (security_prepare_creds(new, old, GFP_KERNEL) < 0) goto error; + atomic_set(&new->usage, 1); + set_cred_subscribers(new, 0); put_cred(old); validate_creds(new); return new; @@ -748,11 +748,7 @@ bool creds_are_invalid(const struct cred *cred) if (cred->magic != CRED_MAGIC) return true; #ifdef CONFIG_SECURITY_SELINUX - /* - * cred->security == NULL if security_cred_alloc_blank() or - * security_prepare_creds() returned an error. - */ - if (selinux_is_enabled() && cred->security) { + if (selinux_is_enabled()) { if ((unsigned long) cred->security < PAGE_SIZE) return true; if ((*(u32 *)cred->security & 0xffffff00) == diff --git a/trunk/security/selinux/hooks.c b/trunk/security/selinux/hooks.c index c8d699270687..e276eb468536 100644 --- a/trunk/security/selinux/hooks.c +++ b/trunk/security/selinux/hooks.c @@ -3198,11 +3198,7 @@ static void selinux_cred_free(struct cred *cred) { struct task_security_struct *tsec = cred->security; - /* - * cred->security == NULL if security_cred_alloc_blank() or - * security_prepare_creds() returned an error. - */ - BUG_ON(cred->security && (unsigned long) cred->security < PAGE_SIZE); + BUG_ON((unsigned long) cred->security < PAGE_SIZE); cred->security = (void *) 0x7UL; kfree(tsec); }