From: Greg Kroah-Hartman Date: Thu, 29 Jul 2010 00:17:19 +0000 (-0700) Subject: .32 patches X-Git-Tag: v2.6.27.49~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6696626343b9d8c40d194e1fa684de9273226073;p=thirdparty%2Fkernel%2Fstable-queue.git .32 patches --- diff --git a/queue-2.6.32/acpi-skip-checking-bm_sts-if-the-bios-doesn-t-ask-for-it.patch b/queue-2.6.32/acpi-skip-checking-bm_sts-if-the-bios-doesn-t-ask-for-it.patch new file mode 100644 index 00000000000..ddb12a494ee --- /dev/null +++ b/queue-2.6.32/acpi-skip-checking-bm_sts-if-the-bios-doesn-t-ask-for-it.patch @@ -0,0 +1,82 @@ +From 718be4aaf3613cf7c2d097f925abc3d3553c0605 Mon Sep 17 00:00:00 2001 +From: Len Brown +Date: Thu, 22 Jul 2010 16:54:27 -0400 +Subject: ACPI: skip checking BM_STS if the BIOS doesn't ask for it + +From: Len Brown + +commit 718be4aaf3613cf7c2d097f925abc3d3553c0605 upstream. + +It turns out that there is a bit in the _CST for Intel FFH C3 +that tells the OS if we should be checking BM_STS or not. + +Linux has been unconditionally checking BM_STS. +If the chip-set is configured to enable BM_STS, +it can retard or completely prevent entry into +deep C-states -- as illustrated by turbostat: + +http://userweb.kernel.org/~lenb/acpi/utils/pmtools/turbostat/ + +ref: Intel Processor Vendor-Specific ACPI Interface Specification +table 4 "_CST FFH GAS Field Encoding" +Bit 1: Set to 1 if OSPM should use Bus Master avoidance for this C-state + +https://bugzilla.kernel.org/show_bug.cgi?id=15886 + +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/acpi/cstate.c | 9 +++++++++ + drivers/acpi/processor_idle.c | 2 +- + include/acpi/processor.h | 3 ++- + 3 files changed, 12 insertions(+), 2 deletions(-) + +--- a/arch/x86/kernel/acpi/cstate.c ++++ b/arch/x86/kernel/acpi/cstate.c +@@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsi + percpu_entry->states[cx->index].eax = cx->address; + percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK; + } ++ ++ /* ++ * For _CST FFH on Intel, if GAS.access_size bit 1 is cleared, ++ * then we should skip checking BM_STS for this C-state. ++ * ref: "Intel Processor Vendor-Specific ACPI Interface Specification" ++ */ ++ if ((c->x86_vendor == X86_VENDOR_INTEL) && !(reg->access_size & 0x2)) ++ cx->bm_sts_skip = 1; ++ + return retval; + } + EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); +--- a/drivers/acpi/processor_idle.c ++++ b/drivers/acpi/processor_idle.c +@@ -962,7 +962,7 @@ static int acpi_idle_enter_bm(struct cpu + if (acpi_idle_suspend) + return(acpi_idle_enter_c1(dev, state)); + +- if (acpi_idle_bm_check()) { ++ if (!cx->bm_sts_skip && acpi_idle_bm_check()) { + if (dev->safe_state) { + dev->last_state = dev->safe_state; + return dev->safe_state->enter(dev, dev->safe_state); +--- a/include/acpi/processor.h ++++ b/include/acpi/processor.h +@@ -48,7 +48,7 @@ struct acpi_power_register { + u8 space_id; + u8 bit_width; + u8 bit_offset; +- u8 reserved; ++ u8 access_size; + u64 address; + } __attribute__ ((packed)); + +@@ -74,6 +74,7 @@ struct acpi_processor_cx { + u32 power; + u32 usage; + u64 time; ++ u8 bm_sts_skip; + struct acpi_processor_cx_policy promotion; + struct acpi_processor_cx_policy demotion; + char desc[ACPI_CX_DESC_LEN]; diff --git a/queue-2.6.32/acpi-unconditionally-set-sci_en-on-resume.patch b/queue-2.6.32/acpi-unconditionally-set-sci_en-on-resume.patch new file mode 100644 index 00000000000..73f8c089f4f --- /dev/null +++ b/queue-2.6.32/acpi-unconditionally-set-sci_en-on-resume.patch @@ -0,0 +1,252 @@ +From b6dacf63e9fb2e7a1369843d6cef332f76fca6a3 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Tue, 11 May 2010 13:49:25 -0400 +Subject: ACPI: Unconditionally set SCI_EN on resume + +From: Matthew Garrett + +commit b6dacf63e9fb2e7a1369843d6cef332f76fca6a3 upstream. + +The ACPI spec tells us that the firmware will reenable SCI_EN on resume. +Reality disagrees in some cases. The ACPI spec tells us that the only way +to set SCI_EN is via an SMM call. +https://bugzilla.kernel.org/show_bug.cgi?id=13745 shows us that doing so +may break machines. Tracing the ACPI calls made by Windows shows that it +unconditionally sets SCI_EN on resume with a direct register write, and +therefore the overwhelming probability is that everything is fine with +this behaviour. + +Signed-off-by: Matthew Garrett +Tested-by: Rafael J. Wysocki +Signed-off-by: Len Brown +Cc: Kamal Mostafa +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/acpi/sleep.c | 2 + drivers/acpi/sleep.c | 157 ------------------------------------------- + include/linux/acpi.h | 1 + 3 files changed, 2 insertions(+), 158 deletions(-) + +--- a/arch/x86/kernel/acpi/sleep.c ++++ b/arch/x86/kernel/acpi/sleep.c +@@ -162,8 +162,6 @@ static int __init acpi_sleep_setup(char + #endif + if (strncmp(str, "old_ordering", 12) == 0) + acpi_old_suspend_ordering(); +- if (strncmp(str, "sci_force_enable", 16) == 0) +- acpi_set_sci_en_on_resume(); + str = strchr(str, ','); + if (str != NULL) + str += strspn(str, ", \t"); +--- a/drivers/acpi/sleep.c ++++ b/drivers/acpi/sleep.c +@@ -80,22 +80,6 @@ static int acpi_sleep_prepare(u32 acpi_s + + #ifdef CONFIG_ACPI_SLEEP + static u32 acpi_target_sleep_state = ACPI_STATE_S0; +-/* +- * According to the ACPI specification the BIOS should make sure that ACPI is +- * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still, +- * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI +- * on such systems during resume. Unfortunately that doesn't help in +- * particularly pathological cases in which SCI_EN has to be set directly on +- * resume, although the specification states very clearly that this flag is +- * owned by the hardware. The set_sci_en_on_resume variable will be set in such +- * cases. +- */ +-static bool set_sci_en_on_resume; +- +-void __init acpi_set_sci_en_on_resume(void) +-{ +- set_sci_en_on_resume = true; +-} + + /* + * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the +@@ -253,11 +237,8 @@ static int acpi_suspend_enter(suspend_st + break; + } + +- /* If ACPI is not enabled by the BIOS, we need to enable it here. */ +- if (set_sci_en_on_resume) +- acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1); +- else +- acpi_enable(); ++ /* This violates the spec but is required for bug compatibility. */ ++ acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1); + + /* Reprogram control registers and execute _BFS */ + acpi_leave_sleep_state_prep(acpi_state); +@@ -346,12 +327,6 @@ static int __init init_old_suspend_order + return 0; + } + +-static int __init init_set_sci_en_on_resume(const struct dmi_system_id *d) +-{ +- set_sci_en_on_resume = true; +- return 0; +-} +- + static struct dmi_system_id __initdata acpisleep_dmi_table[] = { + { + .callback = init_old_suspend_ordering, +@@ -370,22 +345,6 @@ static struct dmi_system_id __initdata a + }, + }, + { +- .callback = init_set_sci_en_on_resume, +- .ident = "Apple MacBook 1,1", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Apple MacMini 1,1", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"), +- }, +- }, +- { + .callback = init_old_suspend_ordering, + .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)", + .matches = { +@@ -394,94 +353,6 @@ static struct dmi_system_id __initdata a + }, + }, + { +- .callback = init_set_sci_en_on_resume, +- .ident = "Toshiba Satellite L300", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), +- DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L300"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Hewlett-Packard HP G7000 Notebook PC", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "HP G7000 Notebook PC"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Hewlett-Packard HP Pavilion dv3 Notebook PC", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv3 Notebook PC"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Hewlett-Packard Pavilion dv4", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Hewlett-Packard Pavilion dv7", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv7"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Hewlett-Packard Compaq Presario C700 Notebook PC", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "Compaq Presario C700 Notebook PC"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Hewlett-Packard Compaq Presario CQ40 Notebook PC", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "Compaq Presario CQ40 Notebook PC"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Lenovo ThinkPad T410", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +- DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Lenovo ThinkPad T510", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +- DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Lenovo ThinkPad W510", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +- DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Lenovo ThinkPad X201[s]", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +- DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), +- }, +- }, +- { + .callback = init_old_suspend_ordering, + .ident = "Panasonic CF51-2L", + .matches = { +@@ -490,30 +361,6 @@ static struct dmi_system_id __initdata a + DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), + }, + }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Dell Studio 1558", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1558"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Dell Studio 1557", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1557"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Dell Studio 1555", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1555"), +- }, +- }, + {}, + }; + #endif /* CONFIG_SUSPEND */ +--- a/include/linux/acpi.h ++++ b/include/linux/acpi.h +@@ -251,7 +251,6 @@ int acpi_check_mem_region(resource_size_ + void __init acpi_no_s4_hw_signature(void); + void __init acpi_old_suspend_ordering(void); + void __init acpi_s4_no_nvs(void); +-void __init acpi_set_sci_en_on_resume(void); + #endif /* CONFIG_PM_SLEEP */ + + struct acpi_osc_context { diff --git a/queue-2.6.32/futex-futex_find_get_task-remove-credentails-check.patch b/queue-2.6.32/futex-futex_find_get_task-remove-credentails-check.patch new file mode 100644 index 00000000000..89d8f552c30 --- /dev/null +++ b/queue-2.6.32/futex-futex_find_get_task-remove-credentails-check.patch @@ -0,0 +1,82 @@ +From 7a0ea09ad5352efce8fe79ed853150449903b9f5 Mon Sep 17 00:00:00 2001 +From: Michal Hocko +Date: Wed, 30 Jun 2010 09:51:19 +0200 +Subject: futex: futex_find_get_task remove credentails check + +From: Michal Hocko + +commit 7a0ea09ad5352efce8fe79ed853150449903b9f5 upstream. + +futex_find_get_task is currently used (through lookup_pi_state) from two +contexts, futex_requeue and futex_lock_pi_atomic. None of the paths +looks it needs the credentials check, though. Different (e)uids +shouldn't matter at all because the only thing that is important for +shared futex is the accessibility of the shared memory. + +The credentail check results in glibc assert failure or process hang (if +glibc is compiled without assert support) for shared robust pthread +mutex with priority inheritance if a process tries to lock already held +lock owned by a process with a different euid: + +pthread_mutex_lock.c:312: __pthread_mutex_lock_full: Assertion `(-(e)) != 3 || !robust' failed. + +The problem is that futex_lock_pi_atomic which is called when we try to +lock already held lock checks the current holder (tid is stored in the +futex value) to get the PI state. It uses lookup_pi_state which in turn +gets task struct from futex_find_get_task. ESRCH is returned either +when the task is not found or if credentials check fails. + +futex_lock_pi_atomic simply returns if it gets ESRCH. glibc code, +however, doesn't expect that robust lock returns with ESRCH because it +should get either success or owner died. + +Signed-off-by: Michal Hocko +Acked-by: Darren Hart +Cc: Ingo Molnar +Cc: Thomas Gleixner +Cc: Nick Piggin +Cc: Alexey Kuznetsov +Cc: Peter Zijlstra +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/futex.c | 17 ++++------------- + 1 file changed, 4 insertions(+), 13 deletions(-) + +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -429,20 +429,11 @@ static void free_pi_state(struct futex_p + static struct task_struct * futex_find_get_task(pid_t pid) + { + struct task_struct *p; +- const struct cred *cred = current_cred(), *pcred; + + rcu_read_lock(); + p = find_task_by_vpid(pid); +- if (!p) { +- p = ERR_PTR(-ESRCH); +- } else { +- pcred = __task_cred(p); +- if (cred->euid != pcred->euid && +- cred->euid != pcred->uid) +- p = ERR_PTR(-ESRCH); +- else +- get_task_struct(p); +- } ++ if (p) ++ get_task_struct(p); + + rcu_read_unlock(); + +@@ -564,8 +555,8 @@ lookup_pi_state(u32 uval, struct futex_h + if (!pid) + return -ESRCH; + p = futex_find_get_task(pid); +- if (IS_ERR(p)) +- return PTR_ERR(p); ++ if (!p) ++ return -ESRCH; + + /* + * We need to look at the task state flags to figure out, diff --git a/queue-2.6.32/gfs2-fix-up-system-xattrs.patch b/queue-2.6.32/gfs2-fix-up-system-xattrs.patch new file mode 100644 index 00000000000..d8f483cc14d --- /dev/null +++ b/queue-2.6.32/gfs2-fix-up-system-xattrs.patch @@ -0,0 +1,282 @@ +From 2646a1f61a3b5525914757f10fa12b5b94713648 Mon Sep 17 00:00:00 2001 +From: Steven Whitehouse +Date: Fri, 2 Oct 2009 11:50:54 +0100 +Subject: GFS2: Fix up system xattrs + +From: Steven Whitehouse + +commit 2646a1f61a3b5525914757f10fa12b5b94713648 upstream. + +This code has been shamelessly stolen from XFS at the suggestion +of Christoph Hellwig. I've not added support for cached ACLs so +far... watch for that in a later patch, although this is designed +in such a way that they should be easy to add. + +Signed-off-by: Steven Whitehouse +Cc: Christoph Hellwig +Signed-off-by: Greg Kroah-Hartman + +--- + fs/gfs2/acl.c | 170 +++++++++++++++++++++++++++++++++++++------------------- + fs/gfs2/acl.h | 24 +------ + fs/gfs2/xattr.c | 18 ----- + 3 files changed, 120 insertions(+), 92 deletions(-) + +--- a/fs/gfs2/acl.c ++++ b/fs/gfs2/acl.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -26,61 +27,6 @@ + #include "trans.h" + #include "util.h" + +-#define ACL_ACCESS 1 +-#define ACL_DEFAULT 0 +- +-int gfs2_acl_validate_set(struct gfs2_inode *ip, int access, +- struct gfs2_ea_request *er, int *remove, mode_t *mode) +-{ +- struct posix_acl *acl; +- int error; +- +- error = gfs2_acl_validate_remove(ip, access); +- if (error) +- return error; +- +- if (!er->er_data) +- return -EINVAL; +- +- acl = posix_acl_from_xattr(er->er_data, er->er_data_len); +- if (IS_ERR(acl)) +- return PTR_ERR(acl); +- if (!acl) { +- *remove = 1; +- return 0; +- } +- +- error = posix_acl_valid(acl); +- if (error) +- goto out; +- +- if (access) { +- error = posix_acl_equiv_mode(acl, mode); +- if (!error) +- *remove = 1; +- else if (error > 0) +- error = 0; +- } +- +-out: +- posix_acl_release(acl); +- return error; +-} +- +-int gfs2_acl_validate_remove(struct gfs2_inode *ip, int access) +-{ +- if (!GFS2_SB(&ip->i_inode)->sd_args.ar_posix_acl) +- return -EOPNOTSUPP; +- if (!is_owner_or_cap(&ip->i_inode)) +- return -EPERM; +- if (S_ISLNK(ip->i_inode.i_mode)) +- return -EOPNOTSUPP; +- if (!access && !S_ISDIR(ip->i_inode.i_mode)) +- return -EACCES; +- +- return 0; +-} +- + static int acl_get(struct gfs2_inode *ip, const char *name, + struct posix_acl **acl, struct gfs2_ea_location *el, + char **datap, unsigned int *lenp) +@@ -277,3 +223,117 @@ out_brelse: + return error; + } + ++static int gfs2_acl_type(const char *name) ++{ ++ if (strcmp(name, GFS2_POSIX_ACL_ACCESS) == 0) ++ return ACL_TYPE_ACCESS; ++ if (strcmp(name, GFS2_POSIX_ACL_DEFAULT) == 0) ++ return ACL_TYPE_DEFAULT; ++ return -EINVAL; ++} ++ ++static int gfs2_xattr_system_get(struct inode *inode, const char *name, ++ void *buffer, size_t size) ++{ ++ int type; ++ ++ type = gfs2_acl_type(name); ++ if (type < 0) ++ return type; ++ ++ return gfs2_xattr_get(inode, GFS2_EATYPE_SYS, name, buffer, size); ++} ++ ++static int gfs2_set_mode(struct inode *inode, mode_t mode) ++{ ++ int error = 0; ++ ++ if (mode != inode->i_mode) { ++ struct iattr iattr; ++ ++ iattr.ia_valid = ATTR_MODE; ++ iattr.ia_mode = mode; ++ ++ error = gfs2_setattr_simple(GFS2_I(inode), &iattr); ++ } ++ ++ return error; ++} ++ ++static int gfs2_xattr_system_set(struct inode *inode, const char *name, ++ const void *value, size_t size, int flags) ++{ ++ struct gfs2_sbd *sdp = GFS2_SB(inode); ++ struct posix_acl *acl = NULL; ++ int error = 0, type; ++ ++ if (!sdp->sd_args.ar_posix_acl) ++ return -EOPNOTSUPP; ++ ++ type = gfs2_acl_type(name); ++ if (type < 0) ++ return type; ++ if (flags & XATTR_CREATE) ++ return -EINVAL; ++ if (type == ACL_TYPE_DEFAULT && !S_ISDIR(inode->i_mode)) ++ return value ? -EACCES : 0; ++ if ((current_fsuid() != inode->i_uid) && !capable(CAP_FOWNER)) ++ return -EPERM; ++ if (S_ISLNK(inode->i_mode)) ++ return -EOPNOTSUPP; ++ ++ if (!value) ++ goto set_acl; ++ ++ acl = posix_acl_from_xattr(value, size); ++ if (!acl) { ++ /* ++ * acl_set_file(3) may request that we set default ACLs with ++ * zero length -- defend (gracefully) against that here. ++ */ ++ goto out; ++ } ++ if (IS_ERR(acl)) { ++ error = PTR_ERR(acl); ++ goto out; ++ } ++ ++ error = posix_acl_valid(acl); ++ if (error) ++ goto out_release; ++ ++ error = -EINVAL; ++ if (acl->a_count > GFS2_ACL_MAX_ENTRIES) ++ goto out_release; ++ ++ if (type == ACL_TYPE_ACCESS) { ++ mode_t mode = inode->i_mode; ++ error = posix_acl_equiv_mode(acl, &mode); ++ ++ if (error <= 0) { ++ posix_acl_release(acl); ++ acl = NULL; ++ ++ if (error < 0) ++ return error; ++ } ++ ++ error = gfs2_set_mode(inode, mode); ++ if (error) ++ goto out_release; ++ } ++ ++set_acl: ++ error = gfs2_xattr_set(inode, GFS2_EATYPE_SYS, name, value, size, 0); ++out_release: ++ posix_acl_release(acl); ++out: ++ return error; ++} ++ ++struct xattr_handler gfs2_xattr_system_handler = { ++ .prefix = XATTR_SYSTEM_PREFIX, ++ .get = gfs2_xattr_system_get, ++ .set = gfs2_xattr_system_set, ++}; ++ +--- a/fs/gfs2/acl.h ++++ b/fs/gfs2/acl.h +@@ -13,26 +13,12 @@ + #include "incore.h" + + #define GFS2_POSIX_ACL_ACCESS "posix_acl_access" +-#define GFS2_POSIX_ACL_ACCESS_LEN 16 + #define GFS2_POSIX_ACL_DEFAULT "posix_acl_default" +-#define GFS2_POSIX_ACL_DEFAULT_LEN 17 ++#define GFS2_ACL_MAX_ENTRIES 25 + +-#define GFS2_ACL_IS_ACCESS(name, len) \ +- ((len) == GFS2_POSIX_ACL_ACCESS_LEN && \ +- !memcmp(GFS2_POSIX_ACL_ACCESS, (name), (len))) +- +-#define GFS2_ACL_IS_DEFAULT(name, len) \ +- ((len) == GFS2_POSIX_ACL_DEFAULT_LEN && \ +- !memcmp(GFS2_POSIX_ACL_DEFAULT, (name), (len))) +- +-struct gfs2_ea_request; +- +-int gfs2_acl_validate_set(struct gfs2_inode *ip, int access, +- struct gfs2_ea_request *er, +- int *remove, mode_t *mode); +-int gfs2_acl_validate_remove(struct gfs2_inode *ip, int access); +-int gfs2_check_acl(struct inode *inode, int mask); +-int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip); +-int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr); ++extern int gfs2_check_acl(struct inode *inode, int mask); ++extern int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip); ++extern int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr); ++extern struct xattr_handler gfs2_xattr_system_handler; + + #endif /* __ACL_DOT_H__ */ +--- a/fs/gfs2/xattr.c ++++ b/fs/gfs2/xattr.c +@@ -1507,18 +1507,6 @@ static int gfs2_xattr_user_set(struct in + return gfs2_xattr_set(inode, GFS2_EATYPE_USR, name, value, size, flags); + } + +-static int gfs2_xattr_system_get(struct inode *inode, const char *name, +- void *buffer, size_t size) +-{ +- return gfs2_xattr_get(inode, GFS2_EATYPE_SYS, name, buffer, size); +-} +- +-static int gfs2_xattr_system_set(struct inode *inode, const char *name, +- const void *value, size_t size, int flags) +-{ +- return gfs2_xattr_set(inode, GFS2_EATYPE_SYS, name, value, size, flags); +-} +- + static int gfs2_xattr_security_get(struct inode *inode, const char *name, + void *buffer, size_t size) + { +@@ -1543,12 +1531,6 @@ static struct xattr_handler gfs2_xattr_s + .set = gfs2_xattr_security_set, + }; + +-static struct xattr_handler gfs2_xattr_system_handler = { +- .prefix = XATTR_SYSTEM_PREFIX, +- .get = gfs2_xattr_system_get, +- .set = gfs2_xattr_system_set, +-}; +- + struct xattr_handler *gfs2_xattr_handlers[] = { + &gfs2_xattr_user_handler, + &gfs2_xattr_security_handler, diff --git a/queue-2.6.32/pm-x86-save-restore-misc_enable-register.patch b/queue-2.6.32/pm-x86-save-restore-misc_enable-register.patch new file mode 100644 index 00000000000..c67d076c8af --- /dev/null +++ b/queue-2.6.32/pm-x86-save-restore-misc_enable-register.patch @@ -0,0 +1,69 @@ +From 85a0e7539781dad4bfcffd98e72fa9f130f4e40d Mon Sep 17 00:00:00 2001 +From: Ondrej Zary +Date: Tue, 8 Jun 2010 00:32:49 +0200 +Subject: PM / x86: Save/restore MISC_ENABLE register + +From: Ondrej Zary + +commit 85a0e7539781dad4bfcffd98e72fa9f130f4e40d upstream. + +Save/restore MISC_ENABLE register on suspend/resume. +This fixes OOPS (invalid opcode) on resume from STR on Asus P4P800-VM, +which wakes up with MWAIT disabled. + +Fixes https://bugzilla.kernel.org/show_bug.cgi?id=15385 + +Signed-off-by: Ondrej Zary +Tested-by: Alan Stern +Acked-by: H. Peter Anvin +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/include/asm/suspend_32.h | 2 ++ + arch/x86/include/asm/suspend_64.h | 2 ++ + arch/x86/power/cpu.c | 4 ++++ + 3 files changed, 8 insertions(+) + +--- a/arch/x86/include/asm/suspend_32.h ++++ b/arch/x86/include/asm/suspend_32.h +@@ -15,6 +15,8 @@ static inline int arch_prepare_suspend(v + struct saved_context { + u16 es, fs, gs, ss; + unsigned long cr0, cr2, cr3, cr4; ++ u64 misc_enable; ++ bool misc_enable_saved; + struct desc_ptr gdt; + struct desc_ptr idt; + u16 ldt; +--- a/arch/x86/include/asm/suspend_64.h ++++ b/arch/x86/include/asm/suspend_64.h +@@ -27,6 +27,8 @@ struct saved_context { + u16 ds, es, fs, gs, ss; + unsigned long gs_base, gs_kernel_base, fs_base; + unsigned long cr0, cr2, cr3, cr4, cr8; ++ u64 misc_enable; ++ bool misc_enable_saved; + unsigned long efer; + u16 gdt_pad; + u16 gdt_limit; +--- a/arch/x86/power/cpu.c ++++ b/arch/x86/power/cpu.c +@@ -104,6 +104,8 @@ static void __save_processor_state(struc + ctxt->cr4 = read_cr4(); + ctxt->cr8 = read_cr8(); + #endif ++ ctxt->misc_enable_saved = !rdmsrl_safe(MSR_IA32_MISC_ENABLE, ++ &ctxt->misc_enable); + } + + /* Needed by apm.c */ +@@ -176,6 +178,8 @@ static void fix_processor_context(void) + */ + static void __restore_processor_state(struct saved_context *ctxt) + { ++ if (ctxt->misc_enable_saved) ++ wrmsrl(MSR_IA32_MISC_ENABLE, ctxt->misc_enable); + /* + * control registers + */ diff --git a/queue-2.6.32/series b/queue-2.6.32/series index 100bdec8442..44508e05c10 100644 --- a/queue-2.6.32/series +++ b/queue-2.6.32/series @@ -134,3 +134,9 @@ ethtool-fix-potential-user-buffer-overflow-for-ethtool_-g-s-rxfh.patch 0002-KVM-SVM-Handle-MCEs-early-in-the-vmexit-process.patch 0003-KVM-SVM-Implement-workaround-for-Erratum-383.patch 0004-KVM-MMU-invalidate-and-flush-on-spte-small-large-pag.patch +writeback-remove-writeback_inodes_wbc.patch +futex-futex_find_get_task-remove-credentails-check.patch +gfs2-fix-up-system-xattrs.patch +pm-x86-save-restore-misc_enable-register.patch +acpi-skip-checking-bm_sts-if-the-bios-doesn-t-ask-for-it.patch +acpi-unconditionally-set-sci_en-on-resume.patch diff --git a/queue-2.6.32/writeback-remove-writeback_inodes_wbc.patch b/queue-2.6.32/writeback-remove-writeback_inodes_wbc.patch new file mode 100644 index 00000000000..9424cc77cee --- /dev/null +++ b/queue-2.6.32/writeback-remove-writeback_inodes_wbc.patch @@ -0,0 +1,147 @@ +From 9c3a8ee8a1d72c5c0d7fbdf426d80e270ddfa54c Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Thu, 10 Jun 2010 12:07:27 +0200 +Subject: writeback: remove writeback_inodes_wbc + +From: Christoph Hellwig + +commit 9c3a8ee8a1d72c5c0d7fbdf426d80e270ddfa54c upstream. + +This was just an odd wrapper around writeback_inodes_wb. Removing this +also allows to get rid of the bdi member of struct writeback_control +which was rather out of place there. + +Signed-off-by: Christoph Hellwig +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + fs/afs/write.c | 1 - + fs/btrfs/extent_io.c | 2 -- + fs/fs-writeback.c | 12 ++---------- + include/linux/writeback.h | 5 ++--- + mm/backing-dev.c | 3 +-- + mm/page-writeback.c | 3 +-- + 6 files changed, 6 insertions(+), 20 deletions(-) + +--- a/fs/afs/write.c ++++ b/fs/afs/write.c +@@ -709,7 +709,6 @@ int afs_writeback_all(struct afs_vnode * + { + struct address_space *mapping = vnode->vfs_inode.i_mapping; + struct writeback_control wbc = { +- .bdi = mapping->backing_dev_info, + .sync_mode = WB_SYNC_ALL, + .nr_to_write = LONG_MAX, + .range_cyclic = 1, +--- a/fs/btrfs/extent_io.c ++++ b/fs/btrfs/extent_io.c +@@ -2574,7 +2574,6 @@ int extent_write_full_page(struct extent + .sync_io = wbc->sync_mode == WB_SYNC_ALL, + }; + struct writeback_control wbc_writepages = { +- .bdi = wbc->bdi, + .sync_mode = wbc->sync_mode, + .older_than_this = NULL, + .nr_to_write = 64, +@@ -2608,7 +2607,6 @@ int extent_write_locked_range(struct ext + .sync_io = mode == WB_SYNC_ALL, + }; + struct writeback_control wbc_writepages = { +- .bdi = inode->i_mapping->backing_dev_info, + .sync_mode = mode, + .older_than_this = NULL, + .nr_to_write = nr_pages * 2, +--- a/fs/fs-writeback.c ++++ b/fs/fs-writeback.c +@@ -610,8 +610,8 @@ pinned: + return 0; + } + +-static void writeback_inodes_wb(struct bdi_writeback *wb, +- struct writeback_control *wbc) ++void writeback_inodes_wb(struct bdi_writeback *wb, ++ struct writeback_control *wbc) + { + struct super_block *sb = wbc->sb, *pin_sb = NULL; + const int is_blkdev_sb = sb_is_blkdev_sb(sb); +@@ -706,13 +706,6 @@ static void writeback_inodes_wb(struct b + /* Leave any unwritten inodes on b_io */ + } + +-void writeback_inodes_wbc(struct writeback_control *wbc) +-{ +- struct backing_dev_info *bdi = wbc->bdi; +- +- writeback_inodes_wb(&bdi->wb, wbc); +-} +- + /* + * The maximum number of pages to writeout in a single bdi flush/kupdate + * operation. We do this so we don't hold I_SYNC against an inode for +@@ -751,7 +744,6 @@ static long wb_writeback(struct bdi_writ + struct wb_writeback_args *args) + { + struct writeback_control wbc = { +- .bdi = wb->bdi, + .sb = args->sb, + .sync_mode = args->sync_mode, + .older_than_this = NULL, +--- a/include/linux/writeback.h ++++ b/include/linux/writeback.h +@@ -27,8 +27,6 @@ enum writeback_sync_modes { + * in a manner such that unspecified fields are set to zero. + */ + struct writeback_control { +- struct backing_dev_info *bdi; /* If !NULL, only write back this +- queue */ + struct super_block *sb; /* if !NULL, only write inodes from + this super_block */ + enum writeback_sync_modes sync_mode; +@@ -71,7 +69,8 @@ int inode_wait(void *); + void writeback_inodes_sb(struct super_block *); + int writeback_inodes_sb_if_idle(struct super_block *); + void sync_inodes_sb(struct super_block *); +-void writeback_inodes_wbc(struct writeback_control *wbc); ++void writeback_inodes_wb(struct bdi_writeback *wb, ++ struct writeback_control *wbc); + long wb_do_writeback(struct bdi_writeback *wb, int force_wait); + void wakeup_flusher_threads(long nr_pages); + +--- a/mm/backing-dev.c ++++ b/mm/backing-dev.c +@@ -331,14 +331,13 @@ int bdi_has_dirty_io(struct backing_dev_ + static void bdi_flush_io(struct backing_dev_info *bdi) + { + struct writeback_control wbc = { +- .bdi = bdi, + .sync_mode = WB_SYNC_NONE, + .older_than_this = NULL, + .range_cyclic = 1, + .nr_to_write = 1024, + }; + +- writeback_inodes_wbc(&wbc); ++ writeback_inodes_wb(&bdi->wb, &wbc); + } + + /* +--- a/mm/page-writeback.c ++++ b/mm/page-writeback.c +@@ -495,7 +495,6 @@ static void balance_dirty_pages(struct a + + for (;;) { + struct writeback_control wbc = { +- .bdi = bdi, + .sync_mode = WB_SYNC_NONE, + .older_than_this = NULL, + .nr_to_write = write_chunk, +@@ -537,7 +536,7 @@ static void balance_dirty_pages(struct a + * up. + */ + if (bdi_nr_reclaimable > bdi_thresh) { +- writeback_inodes_wbc(&wbc); ++ writeback_inodes_wb(&bdi->wb, &wbc); + pages_written += write_chunk - wbc.nr_to_write; + get_dirty_limits(&background_thresh, &dirty_thresh, + &bdi_thresh, bdi);