From: Greg Kroah-Hartman Date: Tue, 25 May 2010 17:10:15 +0000 (-0700) Subject: .27 patches after review started X-Git-Tag: v2.6.27.47~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cc20ec6381cc73b3ac3625f729b54727675f51d6;p=thirdparty%2Fkernel%2Fstable-queue.git .27 patches after review started add 3 i2c/hwmon patches I forgot add a nfsd patch remove a vfs patch remove 2 ext4 patches that depended on the vfs patch. --- diff --git a/review-2.6.27/ext4-fix-file-fragmentation-during-large-file-write.patch b/rejects/ext4-fix-file-fragmentation-during-large-file-write.patch similarity index 100% rename from review-2.6.27/ext4-fix-file-fragmentation-during-large-file-write.patch rename to rejects/ext4-fix-file-fragmentation-during-large-file-write.patch diff --git a/review-2.6.27/ext4-implement-range_cyclic-in-ext4_da_writepages-instead-of-write_cache_pages.patch b/rejects/ext4-implement-range_cyclic-in-ext4_da_writepages-instead-of-write_cache_pages.patch similarity index 100% rename from review-2.6.27/ext4-implement-range_cyclic-in-ext4_da_writepages-instead-of-write_cache_pages.patch rename to rejects/ext4-implement-range_cyclic-in-ext4_da_writepages-instead-of-write_cache_pages.patch diff --git a/review-2.6.27/vfs-add-no_nrwrite_index_update-writeback-control-flag.patch b/rejects/vfs-add-no_nrwrite_index_update-writeback-control-flag.patch similarity index 100% rename from review-2.6.27/vfs-add-no_nrwrite_index_update-writeback-control-flag.patch rename to rejects/vfs-add-no_nrwrite_index_update-writeback-control-flag.patch diff --git a/review-2.6.27/hwmon-w83781d-request-i-o-ports-individually-for-probing.patch b/review-2.6.27/hwmon-w83781d-request-i-o-ports-individually-for-probing.patch new file mode 100644 index 00000000000..13acd5b4862 --- /dev/null +++ b/review-2.6.27/hwmon-w83781d-request-i-o-ports-individually-for-probing.patch @@ -0,0 +1,69 @@ +From b0bcdd3cd0adb85a7686b396ba50493871b1135c Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Fri, 5 Feb 2010 19:58:36 +0100 +Subject: hwmon: (w83781d) Request I/O ports individually for probing + +From: Jean Delvare + +commit b0bcdd3cd0adb85a7686b396ba50493871b1135c upstream. + +Different motherboards have different PNP declarations for +W83781D/W83782D chips. Some declare the whole range of I/O ports (8 +ports), some declare only the useful ports (2 ports at offset 5) and +some declare fancy ranges, for example 4 ports at offset 4. To +properly handle all cases, request all ports individually for probing. +After we have determined that we really have a W83781D or W83782D +chip, the useful port range will be requested again, as a single +block. + +I did not see a board which needs this yet, but I know of one for lm78 +driver and I'd like to keep the logic of these two drivers in sync. + +Signed-off-by: Jean Delvare +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hwmon/w83781d.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +--- a/drivers/hwmon/w83781d.c ++++ b/drivers/hwmon/w83781d.c +@@ -1797,17 +1797,17 @@ static int __init + w83781d_isa_found(unsigned short address) + { + int val, save, found = 0; ++ int port; + +- /* We have to request the region in two parts because some +- boards declare base+4 to base+7 as a PNP device */ +- if (!request_region(address, 4, "w83781d")) { +- pr_debug("w83781d: Failed to request low part of region\n"); +- return 0; +- } +- if (!request_region(address + 4, 4, "w83781d")) { +- pr_debug("w83781d: Failed to request high part of region\n"); +- release_region(address, 4); +- return 0; ++ /* Some boards declare base+0 to base+7 as a PNP device, some base+4 ++ * to base+7 and some base+5 to base+6. So we better request each port ++ * individually for the probing phase. */ ++ for (port = address; port < address + W83781D_EXTENT; port++) { ++ if (!request_region(port, 1, "w83781d")) { ++ pr_debug("w83781d: Failed to request port 0x%x\n", ++ port); ++ goto release; ++ } + } + + #define REALLY_SLOW_IO +@@ -1881,8 +1881,8 @@ w83781d_isa_found(unsigned short address + val == 0x30 ? "W83782D" : "W83781D", (int)address); + + release: +- release_region(address + 4, 4); +- release_region(address, 4); ++ for (port--; port >= address; port--) ++ release_region(port, 1); + return found; + } + diff --git a/review-2.6.27/i2c-i801-don-t-use-the-block-buffer-for-i2c-block-writes.patch b/review-2.6.27/i2c-i801-don-t-use-the-block-buffer-for-i2c-block-writes.patch new file mode 100644 index 00000000000..9a1752fe6ed --- /dev/null +++ b/review-2.6.27/i2c-i801-don-t-use-the-block-buffer-for-i2c-block-writes.patch @@ -0,0 +1,38 @@ +From c074c39d62306efa5ba7c69c1a1531bc7333d252 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Sat, 13 Mar 2010 20:56:53 +0100 +Subject: i2c-i801: Don't use the block buffer for I2C block writes + +From: Jean Delvare + +commit c074c39d62306efa5ba7c69c1a1531bc7333d252 upstream. + +Experience has shown that the block buffer can only be used for SMBus +(not I2C) block transactions, even though the datasheet doesn't +mention this limitation. + +Reported-by: Felix Rubinstein +Signed-off-by: Jean Delvare +Cc: Oleg Ryjkov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/i2c/busses/i2c-i801.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/i2c/busses/i2c-i801.c ++++ b/drivers/i2c/busses/i2c-i801.c +@@ -413,9 +413,11 @@ static int i801_block_transaction(union + data->block[0] = 32; /* max for SMBus block reads */ + } + ++ /* Experience has shown that the block buffer can only be used for ++ SMBus (not I2C) block transactions, even though the datasheet ++ doesn't mention this limitation. */ + if ((i801_features & FEATURE_BLOCK_BUFFER) +- && !(command == I2C_SMBUS_I2C_BLOCK_DATA +- && read_write == I2C_SMBUS_READ) ++ && command != I2C_SMBUS_I2C_BLOCK_DATA + && i801_set_block_buffer_mode() == 0) + result = i801_block_transaction_by_block(data, read_write, + hwpec); diff --git a/review-2.6.27/i2c-tiny-usb-fix-on-big-endian-systems.patch b/review-2.6.27/i2c-tiny-usb-fix-on-big-endian-systems.patch new file mode 100644 index 00000000000..312053bcd0e --- /dev/null +++ b/review-2.6.27/i2c-tiny-usb-fix-on-big-endian-systems.patch @@ -0,0 +1,78 @@ +From 1c010ff8912cbc08d80e865aab9c32b6b00c527d Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Fri, 5 Feb 2010 17:48:13 +0100 +Subject: i2c-tiny-usb: Fix on big-endian systems + +From: Jean Delvare + +commit 1c010ff8912cbc08d80e865aab9c32b6b00c527d upstream. + +The functionality bit vector is always returned as a little-endian +32-bit number by the device, so it must be byte-swapped to the host +endianness. + +On the other hand, the delay value is handled by the USB stack, so no +byte swapping is needed on our side. + +This fixes bug #15105: +http://bugzilla.kernel.org/show_bug.cgi?id=15105 + +Reported-by: Jens Richter +Signed-off-by: Jean Delvare +Tested-by: Jens Richter +Cc: Till Harbaum +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/i2c/busses/i2c-tiny-usb.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/drivers/i2c/busses/i2c-tiny-usb.c ++++ b/drivers/i2c/busses/i2c-tiny-usb.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + /* include interfaces to usb layer */ + #include +@@ -31,8 +32,8 @@ + #define CMD_I2C_IO_END (1<<1) + + /* i2c bit delay, default is 10us -> 100kHz */ +-static int delay = 10; +-module_param(delay, int, 0); ++static unsigned short delay = 10; ++module_param(delay, ushort, 0); + MODULE_PARM_DESC(delay, "bit delay in microseconds, " + "e.g. 10 for 100kHz (default is 100kHz)"); + +@@ -109,7 +110,7 @@ static int usb_xfer(struct i2c_adapter * + + static u32 usb_func(struct i2c_adapter *adapter) + { +- u32 func; ++ __le32 func; + + /* get functionality from adapter */ + if (usb_read(adapter, CMD_GET_FUNC, 0, 0, &func, sizeof(func)) != +@@ -118,7 +119,7 @@ static u32 usb_func(struct i2c_adapter * + return 0; + } + +- return func; ++ return le32_to_cpu(func); + } + + /* This is the actual algorithm we define */ +@@ -216,8 +217,7 @@ static int i2c_tiny_usb_probe(struct usb + "i2c-tiny-usb at bus %03d device %03d", + dev->usb_dev->bus->busnum, dev->usb_dev->devnum); + +- if (usb_write(&dev->adapter, CMD_SET_DELAY, +- cpu_to_le16(delay), 0, NULL, 0) != 0) { ++ if (usb_write(&dev->adapter, CMD_SET_DELAY, delay, 0, NULL, 0) != 0) { + dev_err(&dev->adapter.dev, + "failure setting delay to %dus\n", delay); + retval = -EIO; diff --git a/review-2.6.27/nfsd-fix-vm-overcommit-crash.patch b/review-2.6.27/nfsd-fix-vm-overcommit-crash.patch new file mode 100644 index 00000000000..3db70bf9c6e --- /dev/null +++ b/review-2.6.27/nfsd-fix-vm-overcommit-crash.patch @@ -0,0 +1,136 @@ +From 731572d39fcd3498702eda4600db4c43d51e0b26 Mon Sep 17 00:00:00 2001 +From: Alan Cox +Date: Wed, 29 Oct 2008 14:01:20 -0700 +Subject: nfsd: fix vm overcommit crash + +From: Alan Cox + +commit 731572d39fcd3498702eda4600db4c43d51e0b26 upstream. + +Junjiro R. Okajima reported a problem where knfsd crashes if you are +using it to export shmemfs objects and run strict overcommit. In this +situation the current->mm based modifier to the overcommit goes through a +NULL pointer. + +We could simply check for NULL and skip the modifier but we've caught +other real bugs in the past from mm being NULL here - cases where we did +need a valid mm set up (eg the exec bug about a year ago). + +To preserve the checks and get the logic we want shuffle the checking +around and add a new helper to the vm_ security wrappers + +Also fix a current->mm reference in nommu that should use the passed mm + +[akpm@linux-foundation.org: coding-style fixes] +[akpm@linux-foundation.org: fix build] +Reported-by: Junjiro R. Okajima +Acked-by: James Morris +Signed-off-by: Alan Cox +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- a/include/linux/security.h ++++ b/include/linux/security.h +@@ -1585,6 +1585,7 @@ int security_syslog(int type); + int security_settime(struct timespec *ts, struct timezone *tz); + int security_vm_enough_memory(long pages); + int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); ++int security_vm_enough_memory_kern(long pages); + int security_bprm_alloc(struct linux_binprm *bprm); + void security_bprm_free(struct linux_binprm *bprm); + void security_bprm_apply_creds(struct linux_binprm *bprm, int unsafe); +@@ -1820,6 +1821,11 @@ static inline int security_vm_enough_memory(long pages) + return cap_vm_enough_memory(current->mm, pages); + } + ++static inline int security_vm_enough_memory_kern(long pages) ++{ ++ return cap_vm_enough_memory(current->mm, pages); ++} ++ + static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) + { + return cap_vm_enough_memory(mm, pages); +diff --git a/mm/mmap.c b/mm/mmap.c +index 74f4d15..de14ac2 100644 +--- a/mm/mmap.c ++++ b/mm/mmap.c +@@ -175,7 +175,8 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin) + + /* Don't let a single process grow too big: + leave 3% of the size of this process for other processes */ +- allowed -= mm->total_vm / 32; ++ if (mm) ++ allowed -= mm->total_vm / 32; + + /* + * cast `allowed' as a signed long because vm_committed_space +diff --git a/mm/nommu.c b/mm/nommu.c +index 2696b24..7695dc8 100644 +--- a/mm/nommu.c ++++ b/mm/nommu.c +@@ -1454,7 +1454,8 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin) + + /* Don't let a single process grow too big: + leave 3% of the size of this process for other processes */ +- allowed -= current->mm->total_vm / 32; ++ if (mm) ++ allowed -= mm->total_vm / 32; + + /* + * cast `allowed' as a signed long because vm_committed_space +diff --git a/mm/shmem.c b/mm/shmem.c +index d38d7e6..0ed0752 100644 +--- a/mm/shmem.c ++++ b/mm/shmem.c +@@ -161,8 +161,8 @@ static inline struct shmem_sb_info *SHMEM_SB(struct super_block *sb) + */ + static inline int shmem_acct_size(unsigned long flags, loff_t size) + { +- return (flags & VM_ACCOUNT)? +- security_vm_enough_memory(VM_ACCT(size)): 0; ++ return (flags & VM_ACCOUNT) ? ++ security_vm_enough_memory_kern(VM_ACCT(size)) : 0; + } + + static inline void shmem_unacct_size(unsigned long flags, loff_t size) +@@ -179,8 +179,8 @@ static inline void shmem_unacct_size(unsigned long flags, loff_t size) + */ + static inline int shmem_acct_block(unsigned long flags) + { +- return (flags & VM_ACCOUNT)? +- 0: security_vm_enough_memory(VM_ACCT(PAGE_CACHE_SIZE)); ++ return (flags & VM_ACCOUNT) ? ++ 0 : security_vm_enough_memory_kern(VM_ACCT(PAGE_CACHE_SIZE)); + } + + static inline void shmem_unacct_blocks(unsigned long flags, long pages) +diff --git a/security/security.c b/security/security.c +index 255b085..c0acfa7 100644 +--- a/security/security.c ++++ b/security/security.c +@@ -198,14 +198,23 @@ int security_settime(struct timespec *ts, struct timezone *tz) + + int security_vm_enough_memory(long pages) + { ++ WARN_ON(current->mm == NULL); + return security_ops->vm_enough_memory(current->mm, pages); + } + + int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) + { ++ WARN_ON(mm == NULL); + return security_ops->vm_enough_memory(mm, pages); + } + ++int security_vm_enough_memory_kern(long pages) ++{ ++ /* If current->mm is a kernel thread then we will pass NULL, ++ for this specific case that is fine */ ++ return security_ops->vm_enough_memory(current->mm, pages); ++} ++ + int security_bprm_alloc(struct linux_binprm *bprm) + { + return security_ops->bprm_alloc_security(bprm); diff --git a/review-2.6.27/series b/review-2.6.27/series index 3e6bc1f9c9b..5f849e44d33 100644 --- a/review-2.6.27/series +++ b/review-2.6.27/series @@ -7,9 +7,6 @@ ext4-retry-block-reservation.patch ext4-retry-block-allocation-if-we-have-free-blocks-left.patch ext4-use-tag-dirty-lookup-during-mpage_da_submit_io.patch vfs-remove-the-range_cont-writeback-mode.patch -vfs-add-no_nrwrite_index_update-writeback-control-flag.patch -ext4-fix-file-fragmentation-during-large-file-write.patch -ext4-implement-range_cyclic-in-ext4_da_writepages-instead-of-write_cache_pages.patch tty-release_one_tty-forgets-to-put-pids.patch megaraid_sas-fix-for-32bit-apps.patch trace-fix-inappropriate-substraction-on-tracing_pages_allocated-in-trace_free_page.patch @@ -22,3 +19,7 @@ i2c-fix-probing-of-fsc-hardware-monitoring-chips.patch libata-ensure-ncq-error-result-taskfile-is-fully-initialized-before-returning-it-via-qc-result_tf.patch libata-retry-fs-ios-even-if-it-has-failed-with-ac_err_invalid.patch svc-clean-up-deferred-requests-on-transport-destruction.patch +hwmon-w83781d-request-i-o-ports-individually-for-probing.patch +i2c-i801-don-t-use-the-block-buffer-for-i2c-block-writes.patch +i2c-tiny-usb-fix-on-big-endian-systems.patch +nfsd-fix-vm-overcommit-crash.patch