* [01/27] ARM: 7113/1: mm: Align bank start to MAX_ORDER_NR_PAGES
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [02/27] ARM: 7117/1: perf: fix HW_CACHE_* events on Cortex-A9 Greg KH
` (25 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Michael Bohan, Nicolas Pitre,
Johan Palsson, Rabin Vincent, Linus Walleij, Russell King
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Linus Walleij <linus.walleij@linaro.org>
commit 002ea9eefec98dada56fd5f8e432a4e8570c2a26 upstream.
The VM subsystem assumes that there are valid memmap entries from
the bank start aligned to MAX_ORDER_NR_PAGES.
On the Ux500 we have a lot of mem=N arguments on the commandline
triggering this bug several times over and causing kernel
oops messages.
Cc: Michael Bohan <mbohan@codeaurora.org>
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Johan Palsson <johan.palsson@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/arm/mm/init.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -473,6 +473,13 @@ static void __init free_unused_memmap(st
*/
bank_start = min(bank_start,
ALIGN(prev_bank_end, PAGES_PER_SECTION));
+#else
+ /*
+ * Align down here since the VM subsystem insists that the
+ * memmap entries are valid from the bank start aligned to
+ * MAX_ORDER_NR_PAGES.
+ */
+ bank_start = round_down(bank_start, MAX_ORDER_NR_PAGES);
#endif
/*
* If we had a previous bank, and there is a space
^ permalink raw reply [flat|nested] 37+ messages in thread
* [02/27] ARM: 7117/1: perf: fix HW_CACHE_* events on Cortex-A9
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
2011-10-23 6:24 ` [01/27] ARM: 7113/1: mm: Align bank start to MAX_ORDER_NR_PAGES Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [03/27] HID: usbhid: Add support for SiGma Micro chip Greg KH
` (24 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Jean Pihet, Will Deacon,
Russell King
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Will Deacon <will.deacon@arm.com>
commit 29a541f6c1f6e4a85628bb86071b9e72c9f8be2c upstream.
Using COHERENT_LINE_{MISS,HIT} for cache misses and references
respectively is completely wrong. Instead, use the L1D events which
are a better and more useful approximation despite ignoring instruction
traffic.
Reported-by: Alasdair Grant <alasdair.grant@arm.com>
Reported-by: Matt Horsnell <matt.horsnell@arm.com>
Reported-by: Michael Williams <michael.williams@arm.com>
Cc: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/arm/kernel/perf_event_v7.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/arch/arm/kernel/perf_event_v7.c
+++ b/arch/arm/kernel/perf_event_v7.c
@@ -264,8 +264,8 @@ static const unsigned armv7_a9_perf_map[
[PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
[PERF_COUNT_HW_INSTRUCTIONS] =
ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE,
- [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_COHERENT_LINE_HIT,
- [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_COHERENT_LINE_MISS,
+ [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_DCACHE_ACCESS,
+ [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_DCACHE_REFILL,
[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE,
[PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
[PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES,
^ permalink raw reply [flat|nested] 37+ messages in thread
* [03/27] HID: usbhid: Add support for SiGma Micro chip
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
2011-10-23 6:24 ` [01/27] ARM: 7113/1: mm: Align bank start to MAX_ORDER_NR_PAGES Greg KH
2011-10-23 6:24 ` [02/27] ARM: 7117/1: perf: fix HW_CACHE_* events on Cortex-A9 Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [04/27] hwmon: (w83627ehf) Properly report thermal diode sensors Greg KH
` (23 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Jeremiah Matthey,
Jiri Kosina, Jonathan Nieder
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeremiah Matthey <sprg86@gmail.com>
commit f5e4282586dc0c9dab8c7d32e6c43aa07f68586b upstream.
Patch to add SiGma Micro-based keyboards (1c4f:0002) to hid-quirks.
These keyboards dont seem to allow the records to be initialized, and hence a
timeout occurs when the usbhid driver attempts to initialize them. The patch
just adds the signature for these keyboards to the hid-quirks list with the
setting HID_QUIRK_NO_INIT_REPORTS. This removes the 5-10 second wait for the
timeout to occur.
Signed-off-by: Jeremiah Matthey <sprg86@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/hid/hid-ids.h | 3 +++
drivers/hid/usbhid/hid-quirks.c | 1 +
2 files changed, 4 insertions(+)
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -568,6 +568,9 @@
#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600
+#define USB_VENDOR_ID_SIGMA_MICRO 0x1c4f
+#define USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD 0x0002
+
#define USB_VENDOR_ID_SKYCABLE 0x1223
#define USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER 0x3F07
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -89,6 +89,7 @@ static const struct hid_blacklist {
{ USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH, HID_QUIRK_MULTI_INPUT },
{ USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS, HID_QUIRK_MULTI_INPUT },
+ { USB_VENDOR_ID_SIGMA_MICRO, USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD, HID_QUIRK_NO_INIT_REPORTS },
{ 0, 0 }
};
^ permalink raw reply [flat|nested] 37+ messages in thread
* [04/27] hwmon: (w83627ehf) Properly report thermal diode sensors
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (2 preceding siblings ...)
2011-10-23 6:24 ` [03/27] HID: usbhid: Add support for SiGma Micro chip Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [05/27] Avoid using variable-length arrays in kernel/sys.c Greg KH
` (22 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Jean Delvare, Guenter Roeck
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <khali@linux-fr.org>
commit bf164c58e58328c40ebc597a8ac00cc6840f9703 upstream.
The w83627ehf driver is improperly reporting thermal diode sensors as
type 2, instead of 3. This caused "sensors" and possibly other
monitoring tools to report these sensors as "transistor" instead of
"thermal diode".
Furthermore, diode subtype selection (CPU vs. external) is only
supported by the original W83627EHF/EHG. All later models only support
CPU diode type, and some (NCT6776F) don't even have the register in
question so we should avoid reading from it.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/hwmon/w83627ehf.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -1715,7 +1715,8 @@ static void w83627ehf_device_remove_file
}
/* Get the monitoring functions started */
-static inline void __devinit w83627ehf_init_device(struct w83627ehf_data *data)
+static inline void __devinit w83627ehf_init_device(struct w83627ehf_data *data,
+ enum kinds kind)
{
int i;
u8 tmp, diode;
@@ -1746,10 +1747,16 @@ static inline void __devinit w83627ehf_i
w83627ehf_write_value(data, W83627EHF_REG_VBAT, tmp | 0x01);
/* Get thermal sensor types */
- diode = w83627ehf_read_value(data, W83627EHF_REG_DIODE);
+ switch (kind) {
+ case w83627ehf:
+ diode = w83627ehf_read_value(data, W83627EHF_REG_DIODE);
+ break;
+ default:
+ diode = 0x70;
+ }
for (i = 0; i < 3; i++) {
if ((tmp & (0x02 << i)))
- data->temp_type[i] = (diode & (0x10 << i)) ? 1 : 2;
+ data->temp_type[i] = (diode & (0x10 << i)) ? 1 : 3;
else
data->temp_type[i] = 4; /* thermistor */
}
@@ -2016,7 +2023,7 @@ static int __devinit w83627ehf_probe(str
}
/* Initialize the chip */
- w83627ehf_init_device(data);
+ w83627ehf_init_device(data, sio_data->kind);
data->vrm = vid_which_vrm();
superio_enter(sio_data->sioreg);
^ permalink raw reply [flat|nested] 37+ messages in thread
* [05/27] Avoid using variable-length arrays in kernel/sys.c
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (3 preceding siblings ...)
2011-10-23 6:24 ` [04/27] hwmon: (w83627ehf) Properly report thermal diode sensors Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [06/27] drm/radeon/kms/atom: fix handling of FB scratch indices Greg KH
` (21 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Benjamin Herrenschmidt
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Linus Torvalds <torvalds@linux-foundation.org>
commit a84a79e4d369a73c0130b5858199e949432da4c6 upstream.
The size is always valid, but variable-length arrays generate worse code
for no good reason (unless the function happens to be inlined and the
compiler sees the length for the simple constant it is).
Also, there seems to be some code generation problem on POWER, where
Henrik Bakken reports that register r28 can get corrupted under some
subtle circumstances (interrupt happening at the wrong time?). That all
indicates some seriously broken compiler issues, but since variable
length arrays are bad regardless, there's little point in trying to
chase it down.
"Just don't do that, then".
Reported-by: Henrik Grindal Bakken <henribak@cisco.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
kernel/sys.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1135,7 +1135,7 @@ DECLARE_RWSEM(uts_sem);
static int override_release(char __user *release, int len)
{
int ret = 0;
- char buf[len];
+ char buf[65];
if (current->personality & UNAME26) {
char *rest = UTS_RELEASE;
^ permalink raw reply [flat|nested] 37+ messages in thread
* [06/27] drm/radeon/kms/atom: fix handling of FB scratch indices
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (4 preceding siblings ...)
2011-10-23 6:24 ` [05/27] Avoid using variable-length arrays in kernel/sys.c Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [07/27] cputimer: Cure lock inversion Greg KH
` (20 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Alex Deucher, Dave Airlie
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 5a6e8482a16e61250a9121fc9ec719ab0529e760 upstream.
FB scratch indices are dword indices, but we were treating
them as byte indices. As such, we were getting the wrong
FB scratch data for non-0 indices. Fix the indices and
guard the indexing against indices larger than the scratch
allocation.
Fixes memory corruption on some boards if data was written
past the end of the FB scratch array.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reported-by: Dave Airlie <airlied@redhat.com>
Tested-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/gpu/drm/radeon/atom.c | 15 +++++++++++++--
drivers/gpu/drm/radeon/atom.h | 1 +
2 files changed, 14 insertions(+), 2 deletions(-)
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -277,7 +277,12 @@ static uint32_t atom_get_src_int(atom_ex
case ATOM_ARG_FB:
idx = U8(*ptr);
(*ptr)++;
- val = gctx->scratch[((gctx->fb_base + idx) / 4)];
+ if ((gctx->fb_base + (idx * 4)) > gctx->scratch_size_bytes) {
+ DRM_ERROR("ATOM: fb read beyond scratch region: %d vs. %d\n",
+ gctx->fb_base + (idx * 4), gctx->scratch_size_bytes);
+ val = 0;
+ } else
+ val = gctx->scratch[(gctx->fb_base / 4) + idx];
if (print)
DEBUG("FB[0x%02X]", idx);
break;
@@ -531,7 +536,11 @@ static void atom_put_dst(atom_exec_conte
case ATOM_ARG_FB:
idx = U8(*ptr);
(*ptr)++;
- gctx->scratch[((gctx->fb_base + idx) / 4)] = val;
+ if ((gctx->fb_base + (idx * 4)) > gctx->scratch_size_bytes) {
+ DRM_ERROR("ATOM: fb write beyond scratch region: %d vs. %d\n",
+ gctx->fb_base + (idx * 4), gctx->scratch_size_bytes);
+ } else
+ gctx->scratch[(gctx->fb_base / 4) + idx] = val;
DEBUG("FB[0x%02X]", idx);
break;
case ATOM_ARG_PLL:
@@ -1367,11 +1376,13 @@ int atom_allocate_fb_scratch(struct atom
usage_bytes = firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb * 1024;
}
+ ctx->scratch_size_bytes = 0;
if (usage_bytes == 0)
usage_bytes = 20 * 1024;
/* allocate some scratch memory */
ctx->scratch = kzalloc(usage_bytes, GFP_KERNEL);
if (!ctx->scratch)
return -ENOMEM;
+ ctx->scratch_size_bytes = usage_bytes;
return 0;
}
--- a/drivers/gpu/drm/radeon/atom.h
+++ b/drivers/gpu/drm/radeon/atom.h
@@ -137,6 +137,7 @@ struct atom_context {
int cs_equal, cs_above;
int io_mode;
uint32_t *scratch;
+ int scratch_size_bytes;
};
extern int atom_debug;
^ permalink raw reply [flat|nested] 37+ messages in thread
* [07/27] cputimer: Cure lock inversion
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (5 preceding siblings ...)
2011-10-23 6:24 ` [06/27] drm/radeon/kms/atom: fix handling of FB scratch indices Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [08/27] fuse: fix memory leak Greg KH
` (19 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Peter Zijlstra,
Martin Schwidefsky, Thomas Gleixner
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
commit bcd5cff7216f9b2de0a148cc355eac199dc6f1cf upstream.
There's a lock inversion between the cputimer->lock and rq->lock;
notably the two callchains involved are:
update_rlimit_cpu()
sighand->siglock
set_process_cpu_timer()
cpu_timer_sample_group()
thread_group_cputimer()
cputimer->lock
thread_group_cputime()
task_sched_runtime()
->pi_lock
rq->lock
scheduler_tick()
rq->lock
task_tick_fair()
update_curr()
account_group_exec()
cputimer->lock
Where the first one is enabling a CLOCK_PROCESS_CPUTIME_ID timer, and
the second one is keeping up-to-date.
This problem was introduced by e8abccb7193 ("posix-cpu-timers: Cure
SMP accounting oddities").
Cure the problem by removing the cputimer->lock and rq->lock nesting,
this leaves concurrent enablers doing duplicate work, but the time
wasted should be on the same order otherwise wasted spinning on the
lock and the greater-than assignment filter should ensure we preserve
monotonicity.
Reported-by: Dave Jones <davej@redhat.com>
Reported-by: Simon Kirby <sim@hostway.ca>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Link: http://lkml.kernel.org/r/1318928713.21167.4.camel@twins
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
kernel/posix-cpu-timers.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -274,9 +274,7 @@ void thread_group_cputimer(struct task_s
struct task_cputime sum;
unsigned long flags;
- spin_lock_irqsave(&cputimer->lock, flags);
if (!cputimer->running) {
- cputimer->running = 1;
/*
* The POSIX timer interface allows for absolute time expiry
* values through the TIMER_ABSTIME flag, therefore we have
@@ -284,8 +282,11 @@ void thread_group_cputimer(struct task_s
* it.
*/
thread_group_cputime(tsk, &sum);
+ spin_lock_irqsave(&cputimer->lock, flags);
+ cputimer->running = 1;
update_gt_cputime(&cputimer->cputime, &sum);
- }
+ } else
+ spin_lock_irqsave(&cputimer->lock, flags);
*times = cputimer->cputime;
spin_unlock_irqrestore(&cputimer->lock, flags);
}
^ permalink raw reply [flat|nested] 37+ messages in thread
* [08/27] fuse: fix memory leak
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (6 preceding siblings ...)
2011-10-23 6:24 ` [07/27] cputimer: Cure lock inversion Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [09/27] Platform: fix samsung-laptop DMI identification for N150/N210/220/N230 Greg KH
` (18 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Miklos Szeredi, Josh Boyer
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Miklos Szeredi <mszeredi@suse.cz>
commit 5dfcc87fd79dfb96ed155b524337dbd0da4f5993 upstream.
kmemleak is reporting that 32 bytes are being leaked by FUSE:
unreferenced object 0xe373b270 (size 32):
comm "fusermount", pid 1207, jiffies 4294707026 (age 2675.187s)
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<b05517d7>] kmemleak_alloc+0x27/0x50
[<b0196435>] kmem_cache_alloc+0xc5/0x180
[<b02455be>] fuse_alloc_forget+0x1e/0x20
[<b0245670>] fuse_alloc_inode+0xb0/0xd0
[<b01b1a8c>] alloc_inode+0x1c/0x80
[<b01b290f>] iget5_locked+0x8f/0x1a0
[<b0246022>] fuse_iget+0x72/0x1a0
[<b02461da>] fuse_get_root_inode+0x8a/0x90
[<b02465cf>] fuse_fill_super+0x3ef/0x590
[<b019e56f>] mount_nodev+0x3f/0x90
[<b0244e95>] fuse_mount+0x15/0x20
[<b019d1bc>] mount_fs+0x1c/0xc0
[<b01b5811>] vfs_kern_mount+0x41/0x90
[<b01b5af9>] do_kern_mount+0x39/0xd0
[<b01b7585>] do_mount+0x2e5/0x660
[<b01b7966>] sys_mount+0x66/0xa0
This leak report is consistent and happens once per boot on
3.1.0-rc5-dirty.
This happens if a FORGET request is queued after the fuse device was
released.
Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/fuse/dev.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -258,10 +258,14 @@ void fuse_queue_forget(struct fuse_conn
forget->forget_one.nlookup = nlookup;
spin_lock(&fc->lock);
- fc->forget_list_tail->next = forget;
- fc->forget_list_tail = forget;
- wake_up(&fc->waitq);
- kill_fasync(&fc->fasync, SIGIO, POLL_IN);
+ if (fc->connected) {
+ fc->forget_list_tail->next = forget;
+ fc->forget_list_tail = forget;
+ wake_up(&fc->waitq);
+ kill_fasync(&fc->fasync, SIGIO, POLL_IN);
+ } else {
+ kfree(forget);
+ }
spin_unlock(&fc->lock);
}
^ permalink raw reply [flat|nested] 37+ messages in thread
* [09/27] Platform: fix samsung-laptop DMI identification for N150/N210/220/N230
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (7 preceding siblings ...)
2011-10-23 6:24 ` [08/27] fuse: fix memory leak Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [10/27] HID: magicmouse: ignore ivalid report id while switching modes, v2 Greg KH
` (17 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Thomas Courbon,
Matthew Garrett, Josh Boyer
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Thomas Courbon <thcourbon@gmail.com>
commit 78a7539b881eb557494a7c810625c0307b27296c upstream.
Some samsung latop of the N150/N2{10,20,30} serie are badly detected by the samsung-laptop platform driver, see bug # 36082.
It appears that N230 identifies itself as N150/N210/N220/N230 whereas the other identify themselves as N150/N210/220.
This patch attemtp fix #36082 allowing correct identification for all the said netbook model.
Reported-by: Daniel Eklöf <daniel@ekloef.se>
Signed-off-by: Thomas Courbon <thcourbon@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/platform/x86/samsung-laptop.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -601,6 +601,16 @@ static struct dmi_system_id __initdata s
.callback = dmi_check_cb,
},
{
+ .ident = "N150/N210/N220",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR,
+ "SAMSUNG ELECTRONICS CO., LTD."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "N150/N210/N220"),
+ DMI_MATCH(DMI_BOARD_NAME, "N150/N210/N220"),
+ },
+ .callback = dmi_check_cb,
+ },
+ {
.ident = "N150/N210/N220/N230",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR,
^ permalink raw reply [flat|nested] 37+ messages in thread
* [10/27] HID: magicmouse: ignore ivalid report id while switching modes, v2
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (8 preceding siblings ...)
2011-10-23 6:24 ` [09/27] Platform: fix samsung-laptop DMI identification for N150/N210/220/N230 Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [11/27] [media] uvcvideo: Fix crash when linking entities Greg KH
` (16 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Jiri Kosina, Josh Boyer
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jiri Kosina <jkosina@suse.cz>
commit 35d851df23b093ee027f827fed2213ae5e88fc7a upstream.
This is basically a more generic respin of 23746a6 ("HID: magicmouse: ignore
'ivalid report id' while switching modes") which got reverted later by
c3a492.
It turns out that on some configurations, this is actually still the case
and we are not able to detect in runtime.
The device reponds with 'invalid report id' when feature report switching it
into multitouch mode is sent to it.
This has been silently ignored before 0825411ade ("HID: bt: Wait for ACK
on Sent Reports"), but since this commit, it propagates -EIO from the _raw
callback .
So let the driver ignore -EIO as response to 0xd7,0x01 report, as that's
how the device reacts in normal mode.
Sad, but following reality.
This fixes https://bugzilla.kernel.org/show_bug.cgi?id=35022
Reported-by: Chase Douglas <chase.douglas@canonical.com>
Reported-by: Jaikumar Ganesh <jaikumarg@android.com>
Tested-by: Chase Douglas <chase.douglas@canonical.com>
Tested-by: Jaikumar Ganesh <jaikumarg@android.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/hid/hid-magicmouse.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -501,9 +501,17 @@ static int magicmouse_probe(struct hid_d
}
report->size = 6;
+ /*
+ * Some devices repond with 'invalid report id' when feature
+ * report switching it into multitouch mode is sent to it.
+ *
+ * This results in -EIO from the _raw low-level transport callback,
+ * but there seems to be no other way of switching the mode.
+ * Thus the super-ugly hacky success check below.
+ */
ret = hdev->hid_output_raw_report(hdev, feature, sizeof(feature),
HID_FEATURE_REPORT);
- if (ret != sizeof(feature)) {
+ if (ret != -EIO && ret != sizeof(feature)) {
hid_err(hdev, "unable to request touch data (%d)\n", ret);
goto err_stop_hw;
}
^ permalink raw reply [flat|nested] 37+ messages in thread
* [11/27] [media] uvcvideo: Fix crash when linking entities
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (9 preceding siblings ...)
2011-10-23 6:24 ` [10/27] HID: magicmouse: ignore ivalid report id while switching modes, v2 Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [12/27] hfsplus: ensure bio requests are not smaller than the hardware sectors Greg KH
` (15 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Laurent Pinchart,
Mauro Carvalho Chehab, Josh Boyer
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
commit 4d9b2ebd335d83044b9e6656d0e604e8e1300334 upstream.
The uvc_mc_register_entity() function wrongfully selects the
media_entity associated with a UVC entity when creating links. This
results in access to uninitialized media_entity structures and can hit a
BUG_ON statement in media_entity_create_link(). Fix it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/media/video/uvc/uvc_entity.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/media/video/uvc/uvc_entity.c
+++ b/drivers/media/video/uvc/uvc_entity.c
@@ -49,7 +49,7 @@ static int uvc_mc_register_entity(struct
if (remote == NULL)
return -EINVAL;
- source = (UVC_ENTITY_TYPE(remote) != UVC_TT_STREAMING)
+ source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING)
? (remote->vdev ? &remote->vdev->entity : NULL)
: &remote->subdev.entity;
if (source == NULL)
^ permalink raw reply [flat|nested] 37+ messages in thread
* [12/27] hfsplus: ensure bio requests are not smaller than the hardware sectors
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (10 preceding siblings ...)
2011-10-23 6:24 ` [11/27] [media] uvcvideo: Fix crash when linking entities Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [13/27] drm/ttm: ensure ttm for new node is bound before calling move_notify() Greg KH
` (14 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Seth Forshee,
Christoph Hellwig, Josh Boyer
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Seth Forshee <seth.forshee@canonical.com>
commit 6596528e391ad978a6a120142cba97a1d7324cb6 upstream.
Currently all bio requests are 512 bytes, which may fail for media
whose physical sector size is larger than this. Ensure these
requests are not smaller than the block device logical block size.
BugLink: http://bugs.launchpad.net/bugs/734883
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/hfsplus/hfsplus_fs.h | 16 ++++++++-
fs/hfsplus/part_tbl.c | 32 ++++++++++--------
fs/hfsplus/super.c | 12 +++---
fs/hfsplus/wrapper.c | 83 ++++++++++++++++++++++++++++++++++++------------
4 files changed, 101 insertions(+), 42 deletions(-)
--- a/fs/hfsplus/hfsplus_fs.h
+++ b/fs/hfsplus/hfsplus_fs.h
@@ -13,6 +13,7 @@
#include <linux/fs.h>
#include <linux/mutex.h>
#include <linux/buffer_head.h>
+#include <linux/blkdev.h>
#include "hfsplus_raw.h"
#define DBG_BNODE_REFS 0x00000001
@@ -110,7 +111,9 @@ struct hfsplus_vh;
struct hfs_btree;
struct hfsplus_sb_info {
+ void *s_vhdr_buf;
struct hfsplus_vh *s_vhdr;
+ void *s_backup_vhdr_buf;
struct hfsplus_vh *s_backup_vhdr;
struct hfs_btree *ext_tree;
struct hfs_btree *cat_tree;
@@ -258,6 +261,15 @@ struct hfsplus_readdir_data {
struct hfsplus_cat_key key;
};
+/*
+ * Find minimum acceptible I/O size for an hfsplus sb.
+ */
+static inline unsigned short hfsplus_min_io_size(struct super_block *sb)
+{
+ return max_t(unsigned short, bdev_logical_block_size(sb->s_bdev),
+ HFSPLUS_SECTOR_SIZE);
+}
+
#define hfs_btree_open hfsplus_btree_open
#define hfs_btree_close hfsplus_btree_close
#define hfs_btree_write hfsplus_btree_write
@@ -436,8 +448,8 @@ int hfsplus_compare_dentry(const struct
/* wrapper.c */
int hfsplus_read_wrapper(struct super_block *);
int hfs_part_find(struct super_block *, sector_t *, sector_t *);
-int hfsplus_submit_bio(struct block_device *bdev, sector_t sector,
- void *data, int rw);
+int hfsplus_submit_bio(struct super_block *sb, sector_t sector,
+ void *buf, void **data, int rw);
/* time macros */
#define __hfsp_mt2ut(t) (be32_to_cpu(t) - 2082844800U)
--- a/fs/hfsplus/part_tbl.c
+++ b/fs/hfsplus/part_tbl.c
@@ -88,11 +88,12 @@ static int hfs_parse_old_pmap(struct sup
return -ENOENT;
}
-static int hfs_parse_new_pmap(struct super_block *sb, struct new_pmap *pm,
- sector_t *part_start, sector_t *part_size)
+static int hfs_parse_new_pmap(struct super_block *sb, void *buf,
+ struct new_pmap *pm, sector_t *part_start, sector_t *part_size)
{
struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
int size = be32_to_cpu(pm->pmMapBlkCnt);
+ int buf_size = hfsplus_min_io_size(sb);
int res;
int i = 0;
@@ -107,11 +108,14 @@ static int hfs_parse_new_pmap(struct sup
if (++i >= size)
return -ENOENT;
- res = hfsplus_submit_bio(sb->s_bdev,
- *part_start + HFS_PMAP_BLK + i,
- pm, READ);
- if (res)
- return res;
+ pm = (struct new_pmap *)((u8 *)pm + HFSPLUS_SECTOR_SIZE);
+ if ((u8 *)pm - (u8 *)buf >= buf_size) {
+ res = hfsplus_submit_bio(sb,
+ *part_start + HFS_PMAP_BLK + i,
+ buf, (void **)&pm, READ);
+ if (res)
+ return res;
+ }
} while (pm->pmSig == cpu_to_be16(HFS_NEW_PMAP_MAGIC));
return -ENOENT;
@@ -124,15 +128,15 @@ static int hfs_parse_new_pmap(struct sup
int hfs_part_find(struct super_block *sb,
sector_t *part_start, sector_t *part_size)
{
- void *data;
+ void *buf, *data;
int res;
- data = kmalloc(HFSPLUS_SECTOR_SIZE, GFP_KERNEL);
- if (!data)
+ buf = kmalloc(hfsplus_min_io_size(sb), GFP_KERNEL);
+ if (!buf)
return -ENOMEM;
- res = hfsplus_submit_bio(sb->s_bdev, *part_start + HFS_PMAP_BLK,
- data, READ);
+ res = hfsplus_submit_bio(sb, *part_start + HFS_PMAP_BLK,
+ buf, &data, READ);
if (res)
goto out;
@@ -141,13 +145,13 @@ int hfs_part_find(struct super_block *sb
res = hfs_parse_old_pmap(sb, data, part_start, part_size);
break;
case HFS_NEW_PMAP_MAGIC:
- res = hfs_parse_new_pmap(sb, data, part_start, part_size);
+ res = hfs_parse_new_pmap(sb, buf, data, part_start, part_size);
break;
default:
res = -ENOENT;
break;
}
out:
- kfree(data);
+ kfree(buf);
return res;
}
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -197,17 +197,17 @@ int hfsplus_sync_fs(struct super_block *
write_backup = 1;
}
- error2 = hfsplus_submit_bio(sb->s_bdev,
+ error2 = hfsplus_submit_bio(sb,
sbi->part_start + HFSPLUS_VOLHEAD_SECTOR,
- sbi->s_vhdr, WRITE_SYNC);
+ sbi->s_vhdr_buf, NULL, WRITE_SYNC);
if (!error)
error = error2;
if (!write_backup)
goto out;
- error2 = hfsplus_submit_bio(sb->s_bdev,
+ error2 = hfsplus_submit_bio(sb,
sbi->part_start + sbi->sect_count - 2,
- sbi->s_backup_vhdr, WRITE_SYNC);
+ sbi->s_backup_vhdr_buf, NULL, WRITE_SYNC);
if (!error)
error2 = error;
out:
@@ -251,8 +251,8 @@ static void hfsplus_put_super(struct sup
hfs_btree_close(sbi->ext_tree);
iput(sbi->alloc_file);
iput(sbi->hidden_dir);
- kfree(sbi->s_vhdr);
- kfree(sbi->s_backup_vhdr);
+ kfree(sbi->s_vhdr_buf);
+ kfree(sbi->s_backup_vhdr_buf);
unload_nls(sbi->nls);
kfree(sb->s_fs_info);
sb->s_fs_info = NULL;
--- a/fs/hfsplus/wrapper.c
+++ b/fs/hfsplus/wrapper.c
@@ -31,25 +31,67 @@ static void hfsplus_end_io_sync(struct b
complete(bio->bi_private);
}
-int hfsplus_submit_bio(struct block_device *bdev, sector_t sector,
- void *data, int rw)
+/*
+ * hfsplus_submit_bio - Perfrom block I/O
+ * @sb: super block of volume for I/O
+ * @sector: block to read or write, for blocks of HFSPLUS_SECTOR_SIZE bytes
+ * @buf: buffer for I/O
+ * @data: output pointer for location of requested data
+ * @rw: direction of I/O
+ *
+ * The unit of I/O is hfsplus_min_io_size(sb), which may be bigger than
+ * HFSPLUS_SECTOR_SIZE, and @buf must be sized accordingly. On reads
+ * @data will return a pointer to the start of the requested sector,
+ * which may not be the same location as @buf.
+ *
+ * If @sector is not aligned to the bdev logical block size it will
+ * be rounded down. For writes this means that @buf should contain data
+ * that starts at the rounded-down address. As long as the data was
+ * read using hfsplus_submit_bio() and the same buffer is used things
+ * will work correctly.
+ */
+int hfsplus_submit_bio(struct super_block *sb, sector_t sector,
+ void *buf, void **data, int rw)
{
DECLARE_COMPLETION_ONSTACK(wait);
struct bio *bio;
int ret = 0;
+ unsigned int io_size;
+ loff_t start;
+ int offset;
+
+ /*
+ * Align sector to hardware sector size and find offset. We
+ * assume that io_size is a power of two, which _should_
+ * be true.
+ */
+ io_size = hfsplus_min_io_size(sb);
+ start = (loff_t)sector << HFSPLUS_SECTOR_SHIFT;
+ offset = start & (io_size - 1);
+ sector &= ~((io_size >> HFSPLUS_SECTOR_SHIFT) - 1);
bio = bio_alloc(GFP_NOIO, 1);
bio->bi_sector = sector;
- bio->bi_bdev = bdev;
+ bio->bi_bdev = sb->s_bdev;
bio->bi_end_io = hfsplus_end_io_sync;
bio->bi_private = &wait;
- /*
- * We always submit one sector at a time, so bio_add_page must not fail.
- */
- if (bio_add_page(bio, virt_to_page(data), HFSPLUS_SECTOR_SIZE,
- offset_in_page(data)) != HFSPLUS_SECTOR_SIZE)
- BUG();
+ if (!(rw & WRITE) && data)
+ *data = (u8 *)buf + offset;
+
+ while (io_size > 0) {
+ unsigned int page_offset = offset_in_page(buf);
+ unsigned int len = min_t(unsigned int, PAGE_SIZE - page_offset,
+ io_size);
+
+ ret = bio_add_page(bio, virt_to_page(buf), len, page_offset);
+ if (ret != len) {
+ ret = -EIO;
+ goto out;
+ }
+ io_size -= len;
+ buf = (u8 *)buf + len;
+ }
submit_bio(rw, bio);
wait_for_completion(&wait);
@@ -57,8 +99,9 @@ int hfsplus_submit_bio(struct block_devi
if (!bio_flagged(bio, BIO_UPTODATE))
ret = -EIO;
+out:
bio_put(bio);
- return ret;
+ return ret < 0 ? ret : 0;
}
static int hfsplus_read_mdb(void *bufptr, struct hfsplus_wd *wd)
@@ -147,17 +190,17 @@ int hfsplus_read_wrapper(struct super_bl
}
error = -ENOMEM;
- sbi->s_vhdr = kmalloc(HFSPLUS_SECTOR_SIZE, GFP_KERNEL);
- if (!sbi->s_vhdr)
+ sbi->s_vhdr_buf = kmalloc(hfsplus_min_io_size(sb), GFP_KERNEL);
+ if (!sbi->s_vhdr_buf)
goto out;
- sbi->s_backup_vhdr = kmalloc(HFSPLUS_SECTOR_SIZE, GFP_KERNEL);
- if (!sbi->s_backup_vhdr)
+ sbi->s_backup_vhdr_buf = kmalloc(hfsplus_min_io_size(sb), GFP_KERNEL);
+ if (!sbi->s_backup_vhdr_buf)
goto out_free_vhdr;
reread:
- error = hfsplus_submit_bio(sb->s_bdev,
- part_start + HFSPLUS_VOLHEAD_SECTOR,
- sbi->s_vhdr, READ);
+ error = hfsplus_submit_bio(sb, part_start + HFSPLUS_VOLHEAD_SECTOR,
+ sbi->s_vhdr_buf, (void **)&sbi->s_vhdr,
+ READ);
if (error)
goto out_free_backup_vhdr;
@@ -186,9 +229,9 @@ reread:
goto reread;
}
- error = hfsplus_submit_bio(sb->s_bdev,
- part_start + part_size - 2,
- sbi->s_backup_vhdr, READ);
+ error = hfsplus_submit_bio(sb, part_start + part_size - 2,
+ sbi->s_backup_vhdr_buf,
+ (void **)&sbi->s_backup_vhdr, READ);
if (error)
goto out_free_backup_vhdr;
^ permalink raw reply [flat|nested] 37+ messages in thread
* [13/27] drm/ttm: ensure ttm for new node is bound before calling move_notify()
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (11 preceding siblings ...)
2011-10-23 6:24 ` [12/27] hfsplus: ensure bio requests are not smaller than the hardware sectors Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [14/27] drm/ttm: unbind ttm before destroying node in accel move cleanup Greg KH
` (13 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Ben Skeggs, Dave Airlie,
Josh Boyer
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Skeggs <bskeggs@redhat.com>
commit 8d3bb23609d4ae22803a15d232289fc09a7b61c4 upstream.
This was true for new TTM_PL_SYSTEM and new TTM_PL_TT cases, but wasn't
the case on TTM_PL_SYSTEM<->TTM_PL_TT moves, which causes trouble on some
paths as nouveau's move_notify() hook requires that the dma addresses be
valid at this point.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/gpu/drm/ttm/ttm_bo.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -392,10 +392,12 @@ static int ttm_bo_handle_move_mem(struct
* Create and bind a ttm if required.
*/
- if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED) && (bo->ttm == NULL)) {
- ret = ttm_bo_add_ttm(bo, false);
- if (ret)
- goto out_err;
+ if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) {
+ if (bo->ttm == NULL) {
+ ret = ttm_bo_add_ttm(bo, false);
+ if (ret)
+ goto out_err;
+ }
ret = ttm_tt_set_placement_caching(bo->ttm, mem->placement);
if (ret)
^ permalink raw reply [flat|nested] 37+ messages in thread
* [14/27] drm/ttm: unbind ttm before destroying node in accel move cleanup
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (12 preceding siblings ...)
2011-10-23 6:24 ` [13/27] drm/ttm: ensure ttm for new node is bound before calling move_notify() Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [15/27] CIFS: Fix ERR_PTR dereference in cifs_get_root Greg KH
` (12 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Ben Skeggs, Dave Airlie,
Josh Boyer
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ben Skeggs <bskeggs@redhat.com>
commit eac2095398668f989a3dd8d00be1b87850d78c01 upstream.
Nouveau makes the assumption that if a TTM is bound there will be a mm_node
around for it and the backwards ordering here resulted in a use-after-free
on some eviction paths.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/gpu/drm/ttm/ttm_bo_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -635,13 +635,13 @@ int ttm_bo_move_accel_cleanup(struct ttm
if (ret)
return ret;
- ttm_bo_free_old_node(bo);
if ((man->flags & TTM_MEMTYPE_FLAG_FIXED) &&
(bo->ttm != NULL)) {
ttm_tt_unbind(bo->ttm);
ttm_tt_destroy(bo->ttm);
bo->ttm = NULL;
}
+ ttm_bo_free_old_node(bo);
} else {
/**
* This should help pipeline ordinary buffer moves.
^ permalink raw reply [flat|nested] 37+ messages in thread
* [15/27] CIFS: Fix ERR_PTR dereference in cifs_get_root
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (13 preceding siblings ...)
2011-10-23 6:24 ` [14/27] drm/ttm: unbind ttm before destroying node in accel move cleanup Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [16/27] xfs: start periodic workers later Greg KH
` (11 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Pavel Shilovsky,
Steve French, Josh Boyer
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Pavel Shilovsky <piastryyy@gmail.com>
commit 5b980b01212199833ee8023770fa4cbf1b85e9f4 upstream.
move it to the beginning of the loop.
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/cifs/cifsfs.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -566,6 +566,12 @@ cifs_get_root(struct smb_vol *vol, struc
struct inode *dir = dentry->d_inode;
struct dentry *child;
+ if (!dir) {
+ dput(dentry);
+ dentry = ERR_PTR(-ENOENT);
+ break;
+ }
+
/* skip separators */
while (*s == sep)
s++;
@@ -581,10 +587,6 @@ cifs_get_root(struct smb_vol *vol, struc
mutex_unlock(&dir->i_mutex);
dput(dentry);
dentry = child;
- if (!dentry->d_inode) {
- dput(dentry);
- dentry = ERR_PTR(-ENOENT);
- }
} while (!IS_ERR(dentry));
_FreeXid(xid);
kfree(full_path);
^ permalink raw reply [flat|nested] 37+ messages in thread
* [16/27] xfs: start periodic workers later
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (14 preceding siblings ...)
2011-10-23 6:24 ` [15/27] CIFS: Fix ERR_PTR dereference in cifs_get_root Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [17/27] xfs: use a cursor for bulk AIL insertion Greg KH
` (10 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, greg, Christoph Hellwig
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christoph Hellwig <hch@infradead.org>
commit 2bcf6e970f5a88fa05dced5eeb0326e13d93c4a1 upstream
Start the periodic sync workers only after we have finished xfs_mountfs
and thus fully set up the filesystem structures. Without this we can
call into xfs_qm_sync before the quotainfo strucute is set up if the
mount takes unusually long, and probably hit other incomplete states
as well.
Also clean up the xfs_fs_fill_super error path by using consistent
label names, and removing an impossible to reach case.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Reviewed-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/xfs/linux-2.6/xfs_super.c | 35 ++++++++++++++---------------------
1 file changed, 14 insertions(+), 21 deletions(-)
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -1412,37 +1412,35 @@ xfs_fs_fill_super(
sb->s_time_gran = 1;
set_posix_acl_flag(sb);
- error = xfs_syncd_init(mp);
- if (error)
- goto out_filestream_unmount;
-
xfs_inode_shrinker_register(mp);
error = xfs_mountfs(mp);
if (error)
- goto out_syncd_stop;
+ goto out_filestream_unmount;
+
+ error = xfs_syncd_init(mp);
+ if (error)
+ goto out_unmount;
root = igrab(VFS_I(mp->m_rootip));
if (!root) {
error = ENOENT;
- goto fail_unmount;
+ goto out_syncd_stop;
}
if (is_bad_inode(root)) {
error = EINVAL;
- goto fail_vnrele;
+ goto out_syncd_stop;
}
sb->s_root = d_alloc_root(root);
if (!sb->s_root) {
error = ENOMEM;
- goto fail_vnrele;
+ goto out_iput;
}
return 0;
- out_syncd_stop:
- xfs_inode_shrinker_unregister(mp);
- xfs_syncd_stop(mp);
out_filestream_unmount:
+ xfs_inode_shrinker_unregister(mp);
xfs_filestream_unmount(mp);
out_free_sb:
xfs_freesb(mp);
@@ -1456,17 +1454,12 @@ xfs_fs_fill_super(
out:
return -error;
- fail_vnrele:
- if (sb->s_root) {
- dput(sb->s_root);
- sb->s_root = NULL;
- } else {
- iput(root);
- }
-
- fail_unmount:
- xfs_inode_shrinker_unregister(mp);
+ out_iput:
+ iput(root);
+ out_syncd_stop:
xfs_syncd_stop(mp);
+ out_unmount:
+ xfs_inode_shrinker_unregister(mp);
/*
* Blow away any referenced inode in the filestreams cache.
^ permalink raw reply [flat|nested] 37+ messages in thread
* [17/27] xfs: use a cursor for bulk AIL insertion
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (15 preceding siblings ...)
2011-10-23 6:24 ` [16/27] xfs: start periodic workers later Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [18/27] xfs: do not update xa_last_pushed_lsn for locked items Greg KH
` (9 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, greg, Dave Chinner,
Alex Elder
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dave Chinner <dchinner@redhat.com>
commit 1d8c95a363bf8cd4d4182dd19c01693b635311c2 upstream
xfs: use a cursor for bulk AIL insertion
Delayed logging can insert tens of thousands of log items into the
AIL at the same LSN. When the committing of log commit records
occur, we can get insertions occurring at an LSN that is not at the
end of the AIL. If there are thousands of items in the AIL on the
tail LSN, each insertion has to walk the AIL to find the correct
place to insert the new item into the AIL. This can consume large
amounts of CPU time and block other operations from occurring while
the traversals are in progress.
To avoid this repeated walk, use a AIL cursor to record
where we should be inserting the new items into the AIL without
having to repeat the walk. The cursor infrastructure already
provides this functionality for push walks, so is a simple extension
of existing code. While this will not avoid the initial walk, it
will avoid repeating it tens of thousands of times during a single
checkpoint commit.
This version includes logic improvements from Christoph Hellwig.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/xfs/xfs_trans.c | 27 ++++++++++-
fs/xfs/xfs_trans_ail.c | 109 ++++++++++++++++++++++++++++++++++++++----------
fs/xfs/xfs_trans_priv.h | 10 +++-
3 files changed, 118 insertions(+), 28 deletions(-)
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -1426,6 +1426,7 @@ xfs_trans_committed(
static inline void
xfs_log_item_batch_insert(
struct xfs_ail *ailp,
+ struct xfs_ail_cursor *cur,
struct xfs_log_item **log_items,
int nr_items,
xfs_lsn_t commit_lsn)
@@ -1434,7 +1435,7 @@ xfs_log_item_batch_insert(
spin_lock(&ailp->xa_lock);
/* xfs_trans_ail_update_bulk drops ailp->xa_lock */
- xfs_trans_ail_update_bulk(ailp, log_items, nr_items, commit_lsn);
+ xfs_trans_ail_update_bulk(ailp, cur, log_items, nr_items, commit_lsn);
for (i = 0; i < nr_items; i++)
IOP_UNPIN(log_items[i], 0);
@@ -1452,6 +1453,13 @@ xfs_log_item_batch_insert(
* as an iclog write error even though we haven't started any IO yet. Hence in
* this case all we need to do is IOP_COMMITTED processing, followed by an
* IOP_UNPIN(aborted) call.
+ *
+ * The AIL cursor is used to optimise the insert process. If commit_lsn is not
+ * at the end of the AIL, the insert cursor avoids the need to walk
+ * the AIL to find the insertion point on every xfs_log_item_batch_insert()
+ * call. This saves a lot of needless list walking and is a net win, even
+ * though it slightly increases that amount of AIL lock traffic to set it up
+ * and tear it down.
*/
void
xfs_trans_committed_bulk(
@@ -1463,8 +1471,13 @@ xfs_trans_committed_bulk(
#define LOG_ITEM_BATCH_SIZE 32
struct xfs_log_item *log_items[LOG_ITEM_BATCH_SIZE];
struct xfs_log_vec *lv;
+ struct xfs_ail_cursor cur;
int i = 0;
+ spin_lock(&ailp->xa_lock);
+ xfs_trans_ail_cursor_last(ailp, &cur, commit_lsn);
+ spin_unlock(&ailp->xa_lock);
+
/* unpin all the log items */
for (lv = log_vector; lv; lv = lv->lv_next ) {
struct xfs_log_item *lip = lv->lv_item;
@@ -1493,7 +1506,9 @@ xfs_trans_committed_bulk(
/*
* Not a bulk update option due to unusual item_lsn.
* Push into AIL immediately, rechecking the lsn once
- * we have the ail lock. Then unpin the item.
+ * we have the ail lock. Then unpin the item. This does
+ * not affect the AIL cursor the bulk insert path is
+ * using.
*/
spin_lock(&ailp->xa_lock);
if (XFS_LSN_CMP(item_lsn, lip->li_lsn) > 0)
@@ -1507,7 +1522,7 @@ xfs_trans_committed_bulk(
/* Item is a candidate for bulk AIL insert. */
log_items[i++] = lv->lv_item;
if (i >= LOG_ITEM_BATCH_SIZE) {
- xfs_log_item_batch_insert(ailp, log_items,
+ xfs_log_item_batch_insert(ailp, &cur, log_items,
LOG_ITEM_BATCH_SIZE, commit_lsn);
i = 0;
}
@@ -1515,7 +1530,11 @@ xfs_trans_committed_bulk(
/* make sure we insert the remainder! */
if (i)
- xfs_log_item_batch_insert(ailp, log_items, i, commit_lsn);
+ xfs_log_item_batch_insert(ailp, &cur, log_items, i, commit_lsn);
+
+ spin_lock(&ailp->xa_lock);
+ xfs_trans_ail_cursor_done(ailp, &cur);
+ spin_unlock(&ailp->xa_lock);
}
/*
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -272,9 +272,9 @@ xfs_trans_ail_cursor_clear(
}
/*
- * Return the item in the AIL with the current lsn.
- * Return the current tree generation number for use
- * in calls to xfs_trans_next_ail().
+ * Initialise the cursor to the first item in the AIL with the given @lsn.
+ * This searches the list from lowest LSN to highest. Pass a @lsn of zero
+ * to initialise the cursor to the first item in the AIL.
*/
xfs_log_item_t *
xfs_trans_ail_cursor_first(
@@ -300,31 +300,97 @@ out:
}
/*
- * splice the log item list into the AIL at the given LSN.
+ * Initialise the cursor to the last item in the AIL with the given @lsn.
+ * This searches the list from highest LSN to lowest. If there is no item with
+ * the value of @lsn, then it sets the cursor to the last item with an LSN lower
+ * than @lsn.
+ */
+static struct xfs_log_item *
+__xfs_trans_ail_cursor_last(
+ struct xfs_ail *ailp,
+ xfs_lsn_t lsn)
+{
+ xfs_log_item_t *lip;
+
+ list_for_each_entry_reverse(lip, &ailp->xa_ail, li_ail) {
+ if (XFS_LSN_CMP(lip->li_lsn, lsn) <= 0)
+ return lip;
+ }
+ return NULL;
+}
+
+/*
+ * Initialise the cursor to the last item in the AIL with the given @lsn.
+ * This searches the list from highest LSN to lowest.
+ */
+struct xfs_log_item *
+xfs_trans_ail_cursor_last(
+ struct xfs_ail *ailp,
+ struct xfs_ail_cursor *cur,
+ xfs_lsn_t lsn)
+{
+ xfs_trans_ail_cursor_init(ailp, cur);
+ cur->item = __xfs_trans_ail_cursor_last(ailp, lsn);
+ return cur->item;
+}
+
+/*
+ * splice the log item list into the AIL at the given LSN. We splice to the
+ * tail of the given LSN to maintain insert order for push traversals. The
+ * cursor is optional, allowing repeated updates to the same LSN to avoid
+ * repeated traversals.
*/
static void
xfs_ail_splice(
- struct xfs_ail *ailp,
- struct list_head *list,
- xfs_lsn_t lsn)
+ struct xfs_ail *ailp,
+ struct xfs_ail_cursor *cur,
+ struct list_head *list,
+ xfs_lsn_t lsn)
{
- xfs_log_item_t *next_lip;
+ struct xfs_log_item *lip = cur ? cur->item : NULL;
+ struct xfs_log_item *next_lip;
- /* If the list is empty, just insert the item. */
- if (list_empty(&ailp->xa_ail)) {
- list_splice(list, &ailp->xa_ail);
- return;
- }
+ /*
+ * Get a new cursor if we don't have a placeholder or the existing one
+ * has been invalidated.
+ */
+ if (!lip || (__psint_t)lip & 1) {
+ lip = __xfs_trans_ail_cursor_last(ailp, lsn);
- list_for_each_entry_reverse(next_lip, &ailp->xa_ail, li_ail) {
- if (XFS_LSN_CMP(next_lip->li_lsn, lsn) <= 0)
- break;
+ if (!lip) {
+ /* The list is empty, so just splice and return. */
+ if (cur)
+ cur->item = NULL;
+ list_splice(list, &ailp->xa_ail);
+ return;
+ }
}
- ASSERT(&next_lip->li_ail == &ailp->xa_ail ||
- XFS_LSN_CMP(next_lip->li_lsn, lsn) <= 0);
-
- list_splice_init(list, &next_lip->li_ail);
+ /*
+ * Our cursor points to the item we want to insert _after_, so we have
+ * to update the cursor to point to the end of the list we are splicing
+ * in so that it points to the correct location for the next splice.
+ * i.e. before the splice
+ *
+ * lsn -> lsn -> lsn + x -> lsn + x ...
+ * ^
+ * | cursor points here
+ *
+ * After the splice we have:
+ *
+ * lsn -> lsn -> lsn -> lsn -> .... -> lsn -> lsn + x -> lsn + x ...
+ * ^ ^
+ * | cursor points here | needs to move here
+ *
+ * So we set the cursor to the last item in the list to be spliced
+ * before we execute the splice, resulting in the cursor pointing to
+ * the correct item after the splice occurs.
+ */
+ if (cur) {
+ next_lip = list_entry(list->prev, struct xfs_log_item, li_ail);
+ cur->item = next_lip;
+ }
+ list_splice(list, &lip->li_ail);
}
/*
@@ -645,6 +711,7 @@ xfs_trans_unlocked_item(
void
xfs_trans_ail_update_bulk(
struct xfs_ail *ailp,
+ struct xfs_ail_cursor *cur,
struct xfs_log_item **log_items,
int nr_items,
xfs_lsn_t lsn) __releases(ailp->xa_lock)
@@ -674,7 +741,7 @@ xfs_trans_ail_update_bulk(
list_add(&lip->li_ail, &tmp);
}
- xfs_ail_splice(ailp, &tmp, lsn);
+ xfs_ail_splice(ailp, cur, &tmp, lsn);
if (!mlip_changed) {
spin_unlock(&ailp->xa_lock);
--- a/fs/xfs/xfs_trans_priv.h
+++ b/fs/xfs/xfs_trans_priv.h
@@ -82,6 +82,7 @@ struct xfs_ail {
extern struct workqueue_struct *xfs_ail_wq; /* AIL workqueue */
void xfs_trans_ail_update_bulk(struct xfs_ail *ailp,
+ struct xfs_ail_cursor *cur,
struct xfs_log_item **log_items, int nr_items,
xfs_lsn_t lsn) __releases(ailp->xa_lock);
static inline void
@@ -90,7 +91,7 @@ xfs_trans_ail_update(
struct xfs_log_item *lip,
xfs_lsn_t lsn) __releases(ailp->xa_lock)
{
- xfs_trans_ail_update_bulk(ailp, &lip, 1, lsn);
+ xfs_trans_ail_update_bulk(ailp, NULL, &lip, 1, lsn);
}
void xfs_trans_ail_delete_bulk(struct xfs_ail *ailp,
@@ -111,10 +112,13 @@ xfs_lsn_t xfs_ail_min_lsn(struct xfs_ai
void xfs_trans_unlocked_item(struct xfs_ail *,
xfs_log_item_t *);
-struct xfs_log_item *xfs_trans_ail_cursor_first(struct xfs_ail *ailp,
+struct xfs_log_item * xfs_trans_ail_cursor_first(struct xfs_ail *ailp,
struct xfs_ail_cursor *cur,
xfs_lsn_t lsn);
-struct xfs_log_item *xfs_trans_ail_cursor_next(struct xfs_ail *ailp,
+struct xfs_log_item * xfs_trans_ail_cursor_last(struct xfs_ail *ailp,
+ struct xfs_ail_cursor *cur,
+ xfs_lsn_t lsn);
+struct xfs_log_item * xfs_trans_ail_cursor_next(struct xfs_ail *ailp,
struct xfs_ail_cursor *cur);
void xfs_trans_ail_cursor_done(struct xfs_ail *ailp,
struct xfs_ail_cursor *cur);
^ permalink raw reply [flat|nested] 37+ messages in thread
* [18/27] xfs: do not update xa_last_pushed_lsn for locked items
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (16 preceding siblings ...)
2011-10-23 6:24 ` [17/27] xfs: use a cursor for bulk AIL insertion Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [19/27] xfs: force the log if we encounter pinned buffers in .iop_pushbuf Greg KH
` (8 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, greg, Christoph Hellwig
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christoph Hellwig <hch@infradead.org>
commit bc6e588a8971aa74c02e42db4d6e0248679f3738 upstream
If an item was locked we should not update xa_last_pushed_lsn and thus skip
it when restarting the AIL scan as we need to be able to lock and write it
out as soon as possible. Otherwise heavy lock contention might starve AIL
pushing too easily, especially given the larger backoff once we moved
xa_last_pushed_lsn all the way to the target lsn.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Stefan Priebe <s.priebe@profihost.ag>
Tested-by: Stefan Priebe <s.priebe@profihost.ag>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/xfs/xfs_trans_ail.c | 1 -
1 file changed, 1 deletion(-)
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -491,7 +491,6 @@ xfs_ail_worker(
case XFS_ITEM_LOCKED:
XFS_STATS_INC(xs_push_ail_locked);
- ailp->xa_last_pushed_lsn = lsn;
stuck++;
break;
^ permalink raw reply [flat|nested] 37+ messages in thread
* [19/27] xfs: force the log if we encounter pinned buffers in .iop_pushbuf
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (17 preceding siblings ...)
2011-10-23 6:24 ` [18/27] xfs: do not update xa_last_pushed_lsn for locked items Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [20/27] xfs: revert to using a kthread for AIL pushing Greg KH
` (7 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, greg, Christoph Hellwig
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christoph Hellwig <hch@infradead.org>
commit 17b38471c3c07a49f0bbc2ecc2e92050c164e226 upstream
We need to check for pinned buffers even in .iop_pushbuf given that inode
items flush into the same buffers that may be pinned directly due operations
on the unlinked inode list operating directly on buffers. To do this add a
return value to .iop_pushbuf that tells the AIL push about this and use
the existing log force mechanisms to unpin it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Stefan Priebe <s.priebe@profihost.ag>
Tested-by: Stefan Priebe <s.priebe@profihost.ag>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/xfs/quota/xfs_dquot_item.c | 10 +++++++---
fs/xfs/xfs_buf_item.c | 3 ++-
fs/xfs/xfs_inode_item.c | 10 +++++++---
fs/xfs/xfs_trans.h | 2 +-
fs/xfs/xfs_trans_ail.c | 9 +++++++--
5 files changed, 24 insertions(+), 10 deletions(-)
--- a/fs/xfs/quota/xfs_dquot_item.c
+++ b/fs/xfs/quota/xfs_dquot_item.c
@@ -183,13 +183,14 @@ xfs_qm_dqunpin_wait(
* search the buffer cache can be a time consuming thing, and AIL lock is a
* spinlock.
*/
-STATIC void
+STATIC bool
xfs_qm_dquot_logitem_pushbuf(
struct xfs_log_item *lip)
{
struct xfs_dq_logitem *qlip = DQUOT_ITEM(lip);
struct xfs_dquot *dqp = qlip->qli_dquot;
struct xfs_buf *bp;
+ bool ret = true;
ASSERT(XFS_DQ_IS_LOCKED(dqp));
@@ -201,17 +202,20 @@ xfs_qm_dquot_logitem_pushbuf(
if (completion_done(&dqp->q_flush) ||
!(lip->li_flags & XFS_LI_IN_AIL)) {
xfs_dqunlock(dqp);
- return;
+ return true;
}
bp = xfs_incore(dqp->q_mount->m_ddev_targp, qlip->qli_format.qlf_blkno,
dqp->q_mount->m_quotainfo->qi_dqchunklen, XBF_TRYLOCK);
xfs_dqunlock(dqp);
if (!bp)
- return;
+ return true;
if (XFS_BUF_ISDELAYWRITE(bp))
xfs_buf_delwri_promote(bp);
+ if (XFS_BUF_ISPINNED(bp))
+ ret = false;
xfs_buf_relse(bp);
+ return ret;
}
/*
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -632,7 +632,7 @@ xfs_buf_item_push(
* the xfsbufd to get this buffer written. We have to unlock the buffer
* to allow the xfsbufd to write it, too.
*/
-STATIC void
+STATIC bool
xfs_buf_item_pushbuf(
struct xfs_log_item *lip)
{
@@ -646,6 +646,7 @@ xfs_buf_item_pushbuf(
xfs_buf_delwri_promote(bp);
xfs_buf_relse(bp);
+ return true;
}
STATIC void
--- a/fs/xfs/xfs_inode_item.c
+++ b/fs/xfs/xfs_inode_item.c
@@ -713,13 +713,14 @@ xfs_inode_item_committed(
* marked delayed write. If that's the case, we'll promote it and that will
* allow the caller to write the buffer by triggering the xfsbufd to run.
*/
-STATIC void
+STATIC bool
xfs_inode_item_pushbuf(
struct xfs_log_item *lip)
{
struct xfs_inode_log_item *iip = INODE_ITEM(lip);
struct xfs_inode *ip = iip->ili_inode;
struct xfs_buf *bp;
+ bool ret = true;
ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED));
@@ -730,7 +731,7 @@ xfs_inode_item_pushbuf(
if (completion_done(&ip->i_flush) ||
!(lip->li_flags & XFS_LI_IN_AIL)) {
xfs_iunlock(ip, XFS_ILOCK_SHARED);
- return;
+ return true;
}
bp = xfs_incore(ip->i_mount->m_ddev_targp, iip->ili_format.ilf_blkno,
@@ -738,10 +739,13 @@ xfs_inode_item_pushbuf(
xfs_iunlock(ip, XFS_ILOCK_SHARED);
if (!bp)
- return;
+ return true;
if (XFS_BUF_ISDELAYWRITE(bp))
xfs_buf_delwri_promote(bp);
+ if (XFS_BUF_ISPINNED(bp))
+ ret = false;
xfs_buf_relse(bp);
+ return ret;
}
/*
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -350,7 +350,7 @@ typedef struct xfs_item_ops {
void (*iop_unlock)(xfs_log_item_t *);
xfs_lsn_t (*iop_committed)(xfs_log_item_t *, xfs_lsn_t);
void (*iop_push)(xfs_log_item_t *);
- void (*iop_pushbuf)(xfs_log_item_t *);
+ bool (*iop_pushbuf)(xfs_log_item_t *);
void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t);
} xfs_item_ops_t;
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -478,8 +478,13 @@ xfs_ail_worker(
case XFS_ITEM_PUSHBUF:
XFS_STATS_INC(xs_push_ail_pushbuf);
- IOP_PUSHBUF(lip);
- ailp->xa_last_pushed_lsn = lsn;
+
+ if (!IOP_PUSHBUF(lip)) {
+ stuck++;
+ flush_log = 1;
+ } else {
+ ailp->xa_last_pushed_lsn = lsn;
+ }
push_xfsbufd = 1;
break;
^ permalink raw reply [flat|nested] 37+ messages in thread
* [20/27] xfs: revert to using a kthread for AIL pushing
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (18 preceding siblings ...)
2011-10-23 6:24 ` [19/27] xfs: force the log if we encounter pinned buffers in .iop_pushbuf Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [21/27] firewire: sbp2: fix panic after rmmod with slow targets Greg KH
` (6 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, greg, Christoph Hellwig
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Christoph Hellwig <hch@infradead.org>
commit 0030807c66f058230bcb20d2573bcaf28852e804 upstream
Currently we have a few issues with the way the workqueue code is used to
implement AIL pushing:
- it accidentally uses the same workqueue as the syncer action, and thus
can be prevented from running if there are enough sync actions active
in the system.
- it doesn't use the HIGHPRI flag to queue at the head of the queue of
work items
At this point I'm not confident enough in getting all the workqueue flags and
tweaks right to provide a perfectly reliable execution context for AIL
pushing, which is the most important piece in XFS to make forward progress
when the log fills.
Revert back to use a kthread per filesystem which fixes all the above issues
at the cost of having a task struct and stack around for each mounted
filesystem. In addition this also gives us much better ways to diagnose
any issues involving hung AIL pushing and removes a small amount of code.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Stefan Priebe <s.priebe@profihost.ag>
Tested-by: Stefan Priebe <s.priebe@profihost.ag>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/xfs/linux-2.6/xfs_linux.h | 2 +
fs/xfs/linux-2.6/xfs_super.c | 13 -------
fs/xfs/xfs_trans_ail.c | 73 ++++++++++++++++++++++++-------------------
fs/xfs/xfs_trans_priv.h | 8 ----
4 files changed, 45 insertions(+), 51 deletions(-)
--- a/fs/xfs/linux-2.6/xfs_linux.h
+++ b/fs/xfs/linux-2.6/xfs_linux.h
@@ -70,6 +70,8 @@
#include <linux/ctype.h>
#include <linux/writeback.h>
#include <linux/capability.h>
+#include <linux/kthread.h>
+#include <linux/freezer.h>
#include <linux/list_sort.h>
#include <asm/page.h>
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -1660,24 +1660,13 @@ xfs_init_workqueues(void)
*/
xfs_syncd_wq = alloc_workqueue("xfssyncd", WQ_CPU_INTENSIVE, 8);
if (!xfs_syncd_wq)
- goto out;
-
- xfs_ail_wq = alloc_workqueue("xfsail", WQ_CPU_INTENSIVE, 8);
- if (!xfs_ail_wq)
- goto out_destroy_syncd;
-
+ return -ENOMEM;
return 0;
-
-out_destroy_syncd:
- destroy_workqueue(xfs_syncd_wq);
-out:
- return -ENOMEM;
}
STATIC void
xfs_destroy_workqueues(void)
{
- destroy_workqueue(xfs_ail_wq);
destroy_workqueue(xfs_syncd_wq);
}
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -28,8 +28,6 @@
#include "xfs_trans_priv.h"
#include "xfs_error.h"
-struct workqueue_struct *xfs_ail_wq; /* AIL workqueue */
-
#ifdef DEBUG
/*
* Check that the list is sorted as it should be.
@@ -406,16 +404,10 @@ xfs_ail_delete(
xfs_trans_ail_cursor_clear(ailp, lip);
}
-/*
- * xfs_ail_worker does the work of pushing on the AIL. It will requeue itself
- * to run at a later time if there is more work to do to complete the push.
- */
-STATIC void
-xfs_ail_worker(
- struct work_struct *work)
+static long
+xfsaild_push(
+ struct xfs_ail *ailp)
{
- struct xfs_ail *ailp = container_of(to_delayed_work(work),
- struct xfs_ail, xa_work);
xfs_mount_t *mp = ailp->xa_mount;
struct xfs_ail_cursor *cur = &ailp->xa_cursors;
xfs_log_item_t *lip;
@@ -556,20 +548,6 @@ out_done:
/* We're past our target or empty, so idle */
ailp->xa_last_pushed_lsn = 0;
- /*
- * We clear the XFS_AIL_PUSHING_BIT first before checking
- * whether the target has changed. If the target has changed,
- * this pushes the requeue race directly onto the result of the
- * atomic test/set bit, so we are guaranteed that either the
- * the pusher that changed the target or ourselves will requeue
- * the work (but not both).
- */
- clear_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags);
- smp_rmb();
- if (XFS_LSN_CMP(ailp->xa_target, target) == 0 ||
- test_and_set_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags))
- return;
-
tout = 50;
} else if (XFS_LSN_CMP(lsn, target) >= 0) {
/*
@@ -592,9 +570,30 @@ out_done:
tout = 20;
}
- /* There is more to do, requeue us. */
- queue_delayed_work(xfs_syncd_wq, &ailp->xa_work,
- msecs_to_jiffies(tout));
+ return tout;
+}
+
+static int
+xfsaild(
+ void *data)
+{
+ struct xfs_ail *ailp = data;
+ long tout = 0; /* milliseconds */
+
+ while (!kthread_should_stop()) {
+ if (tout && tout <= 20)
+ __set_current_state(TASK_KILLABLE);
+ else
+ __set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(tout ?
+ msecs_to_jiffies(tout) : MAX_SCHEDULE_TIMEOUT);
+
+ try_to_freeze();
+
+ tout = xfsaild_push(ailp);
+ }
+
+ return 0;
}
/*
@@ -629,8 +628,9 @@ xfs_ail_push(
*/
smp_wmb();
xfs_trans_ail_copy_lsn(ailp, &ailp->xa_target, &threshold_lsn);
- if (!test_and_set_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags))
- queue_delayed_work(xfs_syncd_wq, &ailp->xa_work, 0);
+ smp_wmb();
+
+ wake_up_process(ailp->xa_task);
}
/*
@@ -865,9 +865,18 @@ xfs_trans_ail_init(
ailp->xa_mount = mp;
INIT_LIST_HEAD(&ailp->xa_ail);
spin_lock_init(&ailp->xa_lock);
- INIT_DELAYED_WORK(&ailp->xa_work, xfs_ail_worker);
+
+ ailp->xa_task = kthread_run(xfsaild, ailp, "xfsaild/%s",
+ ailp->xa_mount->m_fsname);
+ if (IS_ERR(ailp->xa_task))
+ goto out_free_ailp;
+
mp->m_ail = ailp;
return 0;
+
+out_free_ailp:
+ kmem_free(ailp);
+ return ENOMEM;
}
void
@@ -876,6 +885,6 @@ xfs_trans_ail_destroy(
{
struct xfs_ail *ailp = mp->m_ail;
- cancel_delayed_work_sync(&ailp->xa_work);
+ kthread_stop(ailp->xa_task);
kmem_free(ailp);
}
--- a/fs/xfs/xfs_trans_priv.h
+++ b/fs/xfs/xfs_trans_priv.h
@@ -64,23 +64,17 @@ struct xfs_ail_cursor {
*/
struct xfs_ail {
struct xfs_mount *xa_mount;
+ struct task_struct *xa_task;
struct list_head xa_ail;
xfs_lsn_t xa_target;
struct xfs_ail_cursor xa_cursors;
spinlock_t xa_lock;
- struct delayed_work xa_work;
xfs_lsn_t xa_last_pushed_lsn;
- unsigned long xa_flags;
};
-#define XFS_AIL_PUSHING_BIT 0
-
/*
* From xfs_trans_ail.c
*/
-
-extern struct workqueue_struct *xfs_ail_wq; /* AIL workqueue */
-
void xfs_trans_ail_update_bulk(struct xfs_ail *ailp,
struct xfs_ail_cursor *cur,
struct xfs_log_item **log_items, int nr_items,
^ permalink raw reply [flat|nested] 37+ messages in thread
* [21/27] firewire: sbp2: fix panic after rmmod with slow targets
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (19 preceding siblings ...)
2011-10-23 6:24 ` [20/27] xfs: revert to using a kthread for AIL pushing Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [22/27] VFS: Fix automount for negative autofs dentries Greg KH
` (5 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Chris Boot, Stefan Richter
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Chris Boot <bootc@bootc.net>
commit 0278ccd9d53e07c4e699432b2fed9de6c56f506c upstream.
If firewire-sbp2 starts a login to a target that doesn't complete ORBs
in a timely manner (and has to retry the login), and the module is
removed before the operation times out, you end up with a null-pointer
dereference and a kernel panic.
[SR: This happens because sbp2_target_get/put() do not maintain
module references. scsi_device_get/put() do, but at occasions like
Chris describes one, nobody holds a reference to an SBP-2 sdev.]
This patch cancels pending work for each unit in sbp2_remove(), which
hopefully means there are no extra references around that prevent us
from unloading. This fixes my crash.
Signed-off-by: Chris Boot <bootc@bootc.net>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/firewire/sbp2.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/firewire/sbp2.c
+++ b/drivers/firewire/sbp2.c
@@ -1198,6 +1198,10 @@ static int sbp2_remove(struct device *de
{
struct fw_unit *unit = fw_unit(dev);
struct sbp2_target *tgt = dev_get_drvdata(&unit->device);
+ struct sbp2_logical_unit *lu;
+
+ list_for_each_entry(lu, &tgt->lu_list, link)
+ cancel_delayed_work_sync(&lu->work);
sbp2_target_put(tgt);
return 0;
^ permalink raw reply [flat|nested] 37+ messages in thread
* [22/27] VFS: Fix automount for negative autofs dentries
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (20 preceding siblings ...)
2011-10-23 6:24 ` [21/27] firewire: sbp2: fix panic after rmmod with slow targets Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 7:35 ` Linus Torvalds
2011-10-23 11:41 ` Ian Kent
2011-10-23 6:24 ` [23/27] mm: fix race between mremap and removing migration entry Greg KH
` (4 subsequent siblings)
26 siblings, 2 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, David Howells, Ian Kent,
Al Viro, Chuck Ebbert
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: David Howells <dhowells@redhat.com>
commit 5a30d8a2b8ddd5102c440c7e5a7c8e1fd729c818 upstream.
[ backport for 3.0.x: LOOKUP_PARENT => LOOKUP_CONTINUE by Chuck Ebbert
<cebbert@redhat.com> ]
Autofs may set the DCACHE_NEED_AUTOMOUNT flag on negative dentries. These
need attention from the automounter daemon regardless of the LOOKUP_FOLLOW flag.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Ian Kent <raven@themaw.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/namei.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -779,19 +779,25 @@ static int follow_automount(struct path
if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_CONTINUE))
return -EISDIR; /* we actually want to stop here */
- /* We want to mount if someone is trying to open/create a file of any
- * type under the mountpoint, wants to traverse through the mountpoint
- * or wants to open the mounted directory.
- *
+ /*
* We don't want to mount if someone's just doing a stat and they've
* set AT_SYMLINK_NOFOLLOW - unless they're stat'ing a directory and
* appended a '/' to the name.
*/
- if (!(flags & LOOKUP_FOLLOW) &&
- !(flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY |
- LOOKUP_OPEN | LOOKUP_CREATE)))
- return -EISDIR;
-
+ if (!(flags & LOOKUP_FOLLOW)) {
+ /* We do, however, want to mount if someone wants to open or
+ * create a file of any type under the mountpoint, wants to
+ * traverse through the mountpoint or wants to open the mounted
+ * directory.
+ * Also, autofs may mark negative dentries as being automount
+ * points. These will need the attentions of the daemon to
+ * instantiate them before they can be used.
+ */
+ if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
+ LOOKUP_OPEN | LOOKUP_CREATE)) &&
+ path->dentry->d_inode)
+ return -EISDIR;
+ }
current->total_link_count++;
if (current->total_link_count >= 40)
return -ELOOP;
^ permalink raw reply [flat|nested] 37+ messages in thread
* [23/27] mm: fix race between mremap and removing migration entry
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (21 preceding siblings ...)
2011-10-23 6:24 ` [22/27] VFS: Fix automount for negative autofs dentries Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [24/27] x25: Prevent skb overreads when checking call user data Greg KH
` (3 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Hugh Dickins,
Andrea Arcangeli, Mel Gorman
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2637 bytes --]
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Hugh Dickins <hughd@google.com>
commit 486cf46f3f9be5f2a966016c1a8fe01e32cde09e upstream.
I don't usually pay much attention to the stale "? " addresses in
stack backtraces, but this lucky report from Pawel Sikora hints that
mremap's move_ptes() has inadequate locking against page migration.
3.0 BUG_ON(!PageLocked(p)) in migration_entry_to_page():
kernel BUG at include/linux/swapops.h:105!
RIP: 0010:[<ffffffff81127b76>] [<ffffffff81127b76>]
migration_entry_wait+0x156/0x160
[<ffffffff811016a1>] handle_pte_fault+0xae1/0xaf0
[<ffffffff810feee2>] ? __pte_alloc+0x42/0x120
[<ffffffff8112c26b>] ? do_huge_pmd_anonymous_page+0xab/0x310
[<ffffffff81102a31>] handle_mm_fault+0x181/0x310
[<ffffffff81106097>] ? vma_adjust+0x537/0x570
[<ffffffff81424bed>] do_page_fault+0x11d/0x4e0
[<ffffffff81109a05>] ? do_mremap+0x2d5/0x570
[<ffffffff81421d5f>] page_fault+0x1f/0x30
mremap's down_write of mmap_sem, together with i_mmap_mutex or lock,
and pagetable locks, were good enough before page migration (with its
requirement that every migration entry be found) came in, and enough
while migration always held mmap_sem; but not enough nowadays, when
there's memory hotremove and compaction.
The danger is that move_ptes() lets a migration entry dodge around
behind remove_migration_pte()'s back, so it's in the old location when
looking at the new, then in the new location when looking at the old.
Either mremap's move_ptes() must additionally take anon_vma lock(), or
migration's remove_migration_pte() must stop peeking for is_swap_entry()
before it takes pagetable lock.
Consensus chooses the latter: we prefer to add overhead to migration
than to mremapping, which gets used by JVMs and by exec stack setup.
Reported-and-tested-by: Paweł Sikora <pluto@agmk.net>
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
mm/migrate.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -120,10 +120,10 @@ static int remove_migration_pte(struct p
ptep = pte_offset_map(pmd, addr);
- if (!is_swap_pte(*ptep)) {
- pte_unmap(ptep);
- goto out;
- }
+ /*
+ * Peek to check is_swap_pte() before taking ptlock? No, we
+ * can race mremap's move_ptes(), which skips anon_vma lock.
+ */
ptl = pte_lockptr(mm, pmd);
}
^ permalink raw reply [flat|nested] 37+ messages in thread
* [24/27] x25: Prevent skb overreads when checking call user data
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (22 preceding siblings ...)
2011-10-23 6:24 ` [23/27] mm: fix race between mremap and removing migration entry Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [25/27] crypto: ghash - Avoid null pointer dereference if no key is set Greg KH
` (2 subsequent siblings)
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Matthew Daley, Eric Dumazet,
Andrew Hendry, David S. Miller
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Matthew Daley <mattjd@gmail.com>
commit 7f81e25befdfb3272345a2e775f520e1d515fa20 upstream.
x25_find_listener does not check that the amount of call user data given
in the skb is big enough in per-socket comparisons, hence buffer
overreads may occur. Fix this by adding a check.
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Andrew Hendry <andrew.hendry@gmail.com>
Acked-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/x25/af_x25.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -295,7 +295,8 @@ static struct sock *x25_find_listener(st
* Found a listening socket, now check the incoming
* call user data vs this sockets call user data
*/
- if(skb->len > 0 && x25_sk(s)->cudmatchlength > 0) {
+ if (x25_sk(s)->cudmatchlength > 0 &&
+ skb->len >= x25_sk(s)->cudmatchlength) {
if((memcmp(x25_sk(s)->calluserdata.cuddata,
skb->data,
x25_sk(s)->cudmatchlength)) == 0) {
^ permalink raw reply [flat|nested] 37+ messages in thread
* [25/27] crypto: ghash - Avoid null pointer dereference if no key is set
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (23 preceding siblings ...)
2011-10-23 6:24 ` [24/27] x25: Prevent skb overreads when checking call user data Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [26/27] ALSA: HDA: conexant support for Lenovo T520/W520 Greg KH
2011-10-23 6:24 ` [27/27] ALSA: hda - Add position_fix quirk for Dell Inspiron 1010 Greg KH
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Nick Bowler, Herbert Xu
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Nick Bowler <nbowler@elliptictech.com>
commit 7ed47b7d142ec99ad6880bbbec51e9f12b3af74c upstream.
The ghash_update function passes a pointer to gf128mul_4k_lle which will
be NULL if ghash_setkey is not called or if the most recent call to
ghash_setkey failed to allocate memory. This causes an oops. Fix this
up by returning an error code in the null case.
This is trivially triggered from unprivileged userspace through the
AF_ALG interface by simply writing to the socket without setting a key.
The ghash_final function has a similar issue, but triggering it requires
a memory allocation failure in ghash_setkey _after_ at least one
successful call to ghash_update.
BUG: unable to handle kernel NULL pointer dereference at 00000670
IP: [<d88c92d4>] gf128mul_4k_lle+0x23/0x60 [gf128mul]
*pde = 00000000
Oops: 0000 [#1] PREEMPT SMP
Modules linked in: ghash_generic gf128mul algif_hash af_alg nfs lockd nfs_acl sunrpc bridge ipv6 stp llc
Pid: 1502, comm: hashatron Tainted: G W 3.1.0-rc9-00085-ge9308cf #32 Bochs Bochs
EIP: 0060:[<d88c92d4>] EFLAGS: 00000202 CPU: 0
EIP is at gf128mul_4k_lle+0x23/0x60 [gf128mul]
EAX: d69db1f0 EBX: d6b8ddac ECX: 00000004 EDX: 00000000
ESI: 00000670 EDI: d6b8ddac EBP: d6b8ddc8 ESP: d6b8dda4
DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process hashatron (pid: 1502, ti=d6b8c000 task=d6810000 task.ti=d6b8c000)
Stack:
00000000 d69db1f0 00000163 00000000 d6b8ddc8 c101a520 d69db1f0 d52aa000
00000ff0 d6b8dde8 d88d310f d6b8a3f8 d52aa000 00001000 d88d502c d6b8ddfc
00001000 d6b8ddf4 c11676ed d69db1e8 d6b8de24 c11679ad d52aa000 00000000
Call Trace:
[<c101a520>] ? kmap_atomic_prot+0x37/0xa6
[<d88d310f>] ghash_update+0x85/0xbe [ghash_generic]
[<c11676ed>] crypto_shash_update+0x18/0x1b
[<c11679ad>] shash_ahash_update+0x22/0x36
[<c11679cc>] shash_async_update+0xb/0xd
[<d88ce0ba>] hash_sendpage+0xba/0xf2 [algif_hash]
[<c121b24c>] kernel_sendpage+0x39/0x4e
[<d88ce000>] ? 0xd88cdfff
[<c121b298>] sock_sendpage+0x37/0x3e
[<c121b261>] ? kernel_sendpage+0x4e/0x4e
[<c10b4dbc>] pipe_to_sendpage+0x56/0x61
[<c10b4e1f>] splice_from_pipe_feed+0x58/0xcd
[<c10b4d66>] ? splice_from_pipe_begin+0x10/0x10
[<c10b51f5>] __splice_from_pipe+0x36/0x55
[<c10b4d66>] ? splice_from_pipe_begin+0x10/0x10
[<c10b6383>] splice_from_pipe+0x51/0x64
[<c10b63c2>] ? default_file_splice_write+0x2c/0x2c
[<c10b63d5>] generic_splice_sendpage+0x13/0x15
[<c10b4d66>] ? splice_from_pipe_begin+0x10/0x10
[<c10b527f>] do_splice_from+0x5d/0x67
[<c10b6865>] sys_splice+0x2bf/0x363
[<c129373b>] ? sysenter_exit+0xf/0x16
[<c104dc1e>] ? trace_hardirqs_on_caller+0x10e/0x13f
[<c129370c>] sysenter_do_call+0x12/0x32
Code: 83 c4 0c 5b 5e 5f c9 c3 55 b9 04 00 00 00 89 e5 57 8d 7d e4 56 53 8d 5d e4 83 ec 18 89 45 e0 89 55 dc 0f b6 70 0f c1 e6 04 01 d6 <f3> a5 be 0f 00 00 00 4e 89 d8 e8 48 ff ff ff 8b 45 e0 89 da 0f
EIP: [<d88c92d4>] gf128mul_4k_lle+0x23/0x60 [gf128mul] SS:ESP 0068:d6b8dda4
CR2: 0000000000000670
---[ end trace 4eaa2a86a8e2da24 ]---
note: hashatron[1502] exited with preempt_count 1
BUG: scheduling while atomic: hashatron/1502/0x10000002
INFO: lockdep is turned off.
[...]
Signed-off-by: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
crypto/ghash-generic.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/crypto/ghash-generic.c
+++ b/crypto/ghash-generic.c
@@ -67,6 +67,9 @@ static int ghash_update(struct shash_des
struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
u8 *dst = dctx->buffer;
+ if (!ctx->gf128)
+ return -ENOKEY;
+
if (dctx->bytes) {
int n = min(srclen, dctx->bytes);
u8 *pos = dst + (GHASH_BLOCK_SIZE - dctx->bytes);
@@ -119,6 +122,9 @@ static int ghash_final(struct shash_desc
struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
u8 *buf = dctx->buffer;
+ if (!ctx->gf128)
+ return -ENOKEY;
+
ghash_flush(ctx, dctx);
memcpy(dst, buf, GHASH_BLOCK_SIZE);
^ permalink raw reply [flat|nested] 37+ messages in thread
* [26/27] ALSA: HDA: conexant support for Lenovo T520/W520
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (24 preceding siblings ...)
2011-10-23 6:24 ` [25/27] crypto: ghash - Avoid null pointer dereference if no key is set Greg KH
@ 2011-10-23 6:24 ` Greg KH
2011-10-23 6:24 ` [27/27] ALSA: hda - Add position_fix quirk for Dell Inspiron 1010 Greg KH
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Daniel Suchy, Takashi Iwai
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Daniel Suchy <danny@danysek.cz>
commit ca201c096269ee2d40037fea96a59fd0695888c4 upstream.
This is patch for Conexant codec of Intel HDA driver, adding new quirk
for Lenovo Thinkpad T520 and W520. Conexant autodetection works fine for
T520 (similar subsystem ID is used also in W520 model) and detects more
mixer features compared to generic (fallback) Lenovo quirk with
hardcoded options in Conexant codec.
Patch was activelly tested with Linux 3.0.4, 3.0.6 and 3.0.7 without any
problems.
Signed-off-by: Daniel Suchy <danny@danysek.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
sound/pci/hda/patch_conexant.c | 1 +
1 file changed, 1 insertion(+)
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3097,6 +3097,7 @@ static const struct snd_pci_quirk cxt506
SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS),
SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD),
+ SND_PCI_QUIRK(0x17aa, 0x21cf, "Lenovo T520 & W520", CXT5066_AUTO),
SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21db, "Lenovo X220-tablet", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo U350", CXT5066_ASUS),
^ permalink raw reply [flat|nested] 37+ messages in thread
* [27/27] ALSA: hda - Add position_fix quirk for Dell Inspiron 1010
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
` (25 preceding siblings ...)
2011-10-23 6:24 ` [26/27] ALSA: HDA: conexant support for Lenovo T520/W520 Greg KH
@ 2011-10-23 6:24 ` Greg KH
26 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:24 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan, Takashi Iwai
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1208 bytes --]
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 051a8cb6550d917225ead1cd008b5966350f6d53 upstream.
The previous fix for the position-buffer check gives yet another
regression on a Dell laptop. The safest fix right now is to add a
static quirk for this device (and better to apply it for stable
kernels too).
Reported-by: Éric Piel <Eric.Piel@tremplin-utc.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
sound/pci/hda/hda_intel.c | 1 +
1 file changed, 1 insertion(+)
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2352,6 +2352,7 @@ static struct snd_pci_quirk position_fix
SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB),
+ SND_PCI_QUIRK(0x1028, 0x02c6, "Dell Inspiron 1010", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1028, 0x0470, "Dell Inspiron 1120", POS_FIX_LPIB),
SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
^ permalink raw reply [flat|nested] 37+ messages in thread
* [00/27] 3.0.8-stable review
@ 2011-10-23 6:28 Greg KH
2011-10-23 6:24 ` [01/27] ARM: 7113/1: mm: Align bank start to MAX_ORDER_NR_PAGES Greg KH
` (26 more replies)
0 siblings, 27 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 6:28 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: stable-review, torvalds, akpm, alan
This is the start of the stable review cycle for the 3.0.8 release.
There are @num@ patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let us know. If anyone is a maintainer of the proper subsystem, and
wants to add a Signed-off-by: line to the patch, please respond with it.
Responses should be made by Tuesday, Oct 25 07:00:00 UTC 2011
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.0.8-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
Makefile | 4 +-
arch/arm/kernel/perf_event_v7.c | 4 +-
arch/arm/mm/init.c | 7 ++
crypto/ghash-generic.c | 6 +
drivers/firewire/sbp2.c | 4 +
drivers/gpu/drm/radeon/atom.c | 15 +++-
drivers/gpu/drm/radeon/atom.h | 1 +
drivers/gpu/drm/ttm/ttm_bo.c | 10 +-
drivers/gpu/drm/ttm/ttm_bo_util.c | 2 +-
drivers/hid/hid-ids.h | 3 +
drivers/hid/hid-magicmouse.c | 10 ++-
drivers/hid/usbhid/hid-quirks.c | 1 +
drivers/hwmon/w83627ehf.c | 15 ++-
drivers/media/video/uvc/uvc_entity.c | 2 +-
drivers/platform/x86/samsung-laptop.c | 10 ++
fs/cifs/cifsfs.c | 10 +-
fs/fuse/dev.c | 12 ++-
fs/hfsplus/hfsplus_fs.h | 16 +++-
fs/hfsplus/part_tbl.c | 32 +++---
fs/hfsplus/super.c | 12 +-
fs/hfsplus/wrapper.c | 83 +++++++++++----
fs/namei.c | 24 +++--
fs/xfs/linux-2.6/xfs_linux.h | 2 +
fs/xfs/linux-2.6/xfs_super.c | 48 +++------
fs/xfs/quota/xfs_dquot_item.c | 10 ++-
fs/xfs/xfs_buf_item.c | 3 +-
fs/xfs/xfs_inode_item.c | 10 ++-
fs/xfs/xfs_trans.c | 27 ++++-
fs/xfs/xfs_trans.h | 2 +-
fs/xfs/xfs_trans_ail.c | 192 +++++++++++++++++++++++----------
fs/xfs/xfs_trans_priv.h | 18 ++--
kernel/posix-cpu-timers.c | 7 +-
kernel/sys.c | 2 +-
mm/migrate.c | 8 +-
net/x25/af_x25.c | 3 +-
sound/pci/hda/hda_intel.c | 1 +
sound/pci/hda/patch_conexant.c | 1 +
37 files changed, 421 insertions(+), 196 deletions(-)
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [22/27] VFS: Fix automount for negative autofs dentries
2011-10-23 6:24 ` [22/27] VFS: Fix automount for negative autofs dentries Greg KH
@ 2011-10-23 7:35 ` Linus Torvalds
2011-10-23 8:36 ` Greg KH
2011-10-23 11:59 ` Ian Kent
2011-10-23 11:41 ` Ian Kent
1 sibling, 2 replies; 37+ messages in thread
From: Linus Torvalds @ 2011-10-23 7:35 UTC (permalink / raw)
To: Greg KH
Cc: linux-kernel, stable, stable-review, akpm, alan, David Howells,
Ian Kent, Al Viro, Chuck Ebbert, Miklos Szeredi, Trond Myklebust
This one is debatable.
I think it also wants
- commit 0ec26fd0698285b31248e34bf1abb022c00f23d6 (with
LOOKUP_PARENT->LOOKUP_CONTINUE too)
- commit d94c177beeb4469cd4f6e83354ab0223353e98ed (to get the few
other cases right too)
anything else I missed?
Linus
On Sun, Oct 23, 2011 at 9:24 AM, Greg KH <gregkh@suse.de> wrote:
> 3.0-stable review patch. If anyone has any objections, please let us know.
>
> ------------------
>
> From: David Howells <dhowells@redhat.com>
>
> commit 5a30d8a2b8ddd5102c440c7e5a7c8e1fd729c818 upstream.
> [ backport for 3.0.x: LOOKUP_PARENT => LOOKUP_CONTINUE by Chuck Ebbert
> <cebbert@redhat.com> ]
>
> Autofs may set the DCACHE_NEED_AUTOMOUNT flag on negative dentries. These
> need attention from the automounter daemon regardless of the LOOKUP_FOLLOW flag.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> Acked-by: Ian Kent <raven@themaw.net>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> Cc: Chuck Ebbert <cebbert@redhat.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> ---
> fs/namei.c | 24 +++++++++++++++---------
> 1 file changed, 15 insertions(+), 9 deletions(-)
>
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -779,19 +779,25 @@ static int follow_automount(struct path
> if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_CONTINUE))
> return -EISDIR; /* we actually want to stop here */
>
> - /* We want to mount if someone is trying to open/create a file of any
> - * type under the mountpoint, wants to traverse through the mountpoint
> - * or wants to open the mounted directory.
> - *
> + /*
> * We don't want to mount if someone's just doing a stat and they've
> * set AT_SYMLINK_NOFOLLOW - unless they're stat'ing a directory and
> * appended a '/' to the name.
> */
> - if (!(flags & LOOKUP_FOLLOW) &&
> - !(flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY |
> - LOOKUP_OPEN | LOOKUP_CREATE)))
> - return -EISDIR;
> -
> + if (!(flags & LOOKUP_FOLLOW)) {
> + /* We do, however, want to mount if someone wants to open or
> + * create a file of any type under the mountpoint, wants to
> + * traverse through the mountpoint or wants to open the mounted
> + * directory.
> + * Also, autofs may mark negative dentries as being automount
> + * points. These will need the attentions of the daemon to
> + * instantiate them before they can be used.
> + */
> + if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
> + LOOKUP_OPEN | LOOKUP_CREATE)) &&
> + path->dentry->d_inode)
> + return -EISDIR;
> + }
> current->total_link_count++;
> if (current->total_link_count >= 40)
> return -ELOOP;
>
>
>
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [22/27] VFS: Fix automount for negative autofs dentries
2011-10-23 7:35 ` Linus Torvalds
@ 2011-10-23 8:36 ` Greg KH
2011-10-23 21:09 ` Miklos Szeredi
2011-11-01 15:51 ` David Howells
2011-10-23 11:59 ` Ian Kent
1 sibling, 2 replies; 37+ messages in thread
From: Greg KH @ 2011-10-23 8:36 UTC (permalink / raw)
To: Linus Torvalds, David Howells, Miklos Szeredi
Cc: linux-kernel, stable, stable-review, akpm, alan, Ian Kent,
Al Viro, Chuck Ebbert, Trond Myklebust
On Sun, Oct 23, 2011 at 10:35:14AM +0300, Linus Torvalds wrote:
> This one is debatable.
>
> I think it also wants
>
> - commit 0ec26fd0698285b31248e34bf1abb022c00f23d6 (with
> LOOKUP_PARENT->LOOKUP_CONTINUE too)
Really? I thought I dropped this one from the last stable release due
to problems with it, or does this patch here, and the one you mention
below, resolve those issues?
> - commit d94c177beeb4469cd4f6e83354ab0223353e98ed (to get the few
> other cases right too)
>
> anything else I missed?
Ok, that makes a bit more sense, I'll add these if David and Miklos
agree that they are ok to add here. David and Miklos?
greg k-h
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [22/27] VFS: Fix automount for negative autofs dentries
2011-10-23 6:24 ` [22/27] VFS: Fix automount for negative autofs dentries Greg KH
2011-10-23 7:35 ` Linus Torvalds
@ 2011-10-23 11:41 ` Ian Kent
2011-10-23 11:48 ` Greg KH
1 sibling, 1 reply; 37+ messages in thread
From: Ian Kent @ 2011-10-23 11:41 UTC (permalink / raw)
To: Greg KH
Cc: linux-kernel, stable, stable-review, torvalds, akpm, alan,
David Howells, Al Viro, Chuck Ebbert
On Sun, 2011-10-23 at 08:24 +0200, Greg KH wrote:
> 3.0-stable review patch. If anyone has any objections, please let us know.
Yes, as others point out, either the patch needs to be correctly
backported or the dependent patches need to be pulled in.
I can do either of these, what would you prefer?
>
> ------------------
>
> From: David Howells <dhowells@redhat.com>
>
> commit 5a30d8a2b8ddd5102c440c7e5a7c8e1fd729c818 upstream.
> [ backport for 3.0.x: LOOKUP_PARENT => LOOKUP_CONTINUE by Chuck Ebbert
> <cebbert@redhat.com> ]
>
> Autofs may set the DCACHE_NEED_AUTOMOUNT flag on negative dentries. These
> need attention from the automounter daemon regardless of the LOOKUP_FOLLOW flag.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> Acked-by: Ian Kent <raven@themaw.net>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> Cc: Chuck Ebbert <cebbert@redhat.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> ---
> fs/namei.c | 24 +++++++++++++++---------
> 1 file changed, 15 insertions(+), 9 deletions(-)
>
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -779,19 +779,25 @@ static int follow_automount(struct path
> if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_CONTINUE))
> return -EISDIR; /* we actually want to stop here */
>
> - /* We want to mount if someone is trying to open/create a file of any
> - * type under the mountpoint, wants to traverse through the mountpoint
> - * or wants to open the mounted directory.
> - *
> + /*
> * We don't want to mount if someone's just doing a stat and they've
> * set AT_SYMLINK_NOFOLLOW - unless they're stat'ing a directory and
> * appended a '/' to the name.
> */
> - if (!(flags & LOOKUP_FOLLOW) &&
> - !(flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY |
> - LOOKUP_OPEN | LOOKUP_CREATE)))
> - return -EISDIR;
> -
> + if (!(flags & LOOKUP_FOLLOW)) {
> + /* We do, however, want to mount if someone wants to open or
> + * create a file of any type under the mountpoint, wants to
> + * traverse through the mountpoint or wants to open the mounted
> + * directory.
> + * Also, autofs may mark negative dentries as being automount
> + * points. These will need the attentions of the daemon to
> + * instantiate them before they can be used.
> + */
> + if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
> + LOOKUP_OPEN | LOOKUP_CREATE)) &&
> + path->dentry->d_inode)
> + return -EISDIR;
> + }
> current->total_link_count++;
> if (current->total_link_count >= 40)
> return -ELOOP;
>
>
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [22/27] VFS: Fix automount for negative autofs dentries
2011-10-23 11:41 ` Ian Kent
@ 2011-10-23 11:48 ` Greg KH
2011-10-23 12:07 ` Ian Kent
0 siblings, 1 reply; 37+ messages in thread
From: Greg KH @ 2011-10-23 11:48 UTC (permalink / raw)
To: Ian Kent
Cc: Greg KH, linux-kernel, stable, stable-review, torvalds, akpm,
alan, David Howells, Al Viro, Chuck Ebbert
On Sun, Oct 23, 2011 at 07:41:18PM +0800, Ian Kent wrote:
> On Sun, 2011-10-23 at 08:24 +0200, Greg KH wrote:
> > 3.0-stable review patch. If anyone has any objections, please let us know.
>
> Yes, as others point out, either the patch needs to be correctly
> backported or the dependent patches need to be pulled in.
>
> I can do either of these, what would you prefer?
I'd prefer to take the dependant patches, as that would make things sync
up with what is in Linus's tree, I just wanted to get Miklos's and
David's acks that this is the way to go before I did it.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [22/27] VFS: Fix automount for negative autofs dentries
2011-10-23 7:35 ` Linus Torvalds
2011-10-23 8:36 ` Greg KH
@ 2011-10-23 11:59 ` Ian Kent
1 sibling, 0 replies; 37+ messages in thread
From: Ian Kent @ 2011-10-23 11:59 UTC (permalink / raw)
To: Linus Torvalds
Cc: Greg KH, linux-kernel, stable, stable-review, akpm, alan,
David Howells, Al Viro, Chuck Ebbert, Miklos Szeredi,
Trond Myklebust
On Sun, 2011-10-23 at 10:35 +0300, Linus Torvalds wrote:
> This one is debatable.
>
> I think it also wants
Mmm .. I find myself caught by essentially the same mistake twice in one
day, ;)
>
> - commit 0ec26fd0698285b31248e34bf1abb022c00f23d6 (with
> LOOKUP_PARENT->LOOKUP_CONTINUE too)
Oh right "vfs: automount should ignore LOOKUP_FOLLOW", yes.
>
> - commit d94c177beeb4469cd4f6e83354ab0223353e98ed (to get the few
> other cases right too)
And probably 815d405ceff0d6964683f033e18b9b23a88fba87 as well as
b6c8069d3577481390b3f24a8434ad72a3235594. But I'd need to check that
would be OK.
That should bring 3.0 inline with 3.1.
>
> anything else I missed?
>
> Linus
>
> On Sun, Oct 23, 2011 at 9:24 AM, Greg KH <gregkh@suse.de> wrote:
> > 3.0-stable review patch. If anyone has any objections, please let us know.
> >
> > ------------------
> >
> > From: David Howells <dhowells@redhat.com>
> >
> > commit 5a30d8a2b8ddd5102c440c7e5a7c8e1fd729c818 upstream.
> > [ backport for 3.0.x: LOOKUP_PARENT => LOOKUP_CONTINUE by Chuck Ebbert
> > <cebbert@redhat.com> ]
> >
> > Autofs may set the DCACHE_NEED_AUTOMOUNT flag on negative dentries. These
> > need attention from the automounter daemon regardless of the LOOKUP_FOLLOW flag.
> >
> > Signed-off-by: David Howells <dhowells@redhat.com>
> > Acked-by: Ian Kent <raven@themaw.net>
> > Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> > Cc: Chuck Ebbert <cebbert@redhat.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> >
> > ---
> > fs/namei.c | 24 +++++++++++++++---------
> > 1 file changed, 15 insertions(+), 9 deletions(-)
> >
> > --- a/fs/namei.c
> > +++ b/fs/namei.c
> > @@ -779,19 +779,25 @@ static int follow_automount(struct path
> > if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_CONTINUE))
> > return -EISDIR; /* we actually want to stop here */
> >
> > - /* We want to mount if someone is trying to open/create a file of any
> > - * type under the mountpoint, wants to traverse through the mountpoint
> > - * or wants to open the mounted directory.
> > - *
> > + /*
> > * We don't want to mount if someone's just doing a stat and they've
> > * set AT_SYMLINK_NOFOLLOW - unless they're stat'ing a directory and
> > * appended a '/' to the name.
> > */
> > - if (!(flags & LOOKUP_FOLLOW) &&
> > - !(flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY |
> > - LOOKUP_OPEN | LOOKUP_CREATE)))
> > - return -EISDIR;
> > -
> > + if (!(flags & LOOKUP_FOLLOW)) {
> > + /* We do, however, want to mount if someone wants to open or
> > + * create a file of any type under the mountpoint, wants to
> > + * traverse through the mountpoint or wants to open the mounted
> > + * directory.
> > + * Also, autofs may mark negative dentries as being automount
> > + * points. These will need the attentions of the daemon to
> > + * instantiate them before they can be used.
> > + */
> > + if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
> > + LOOKUP_OPEN | LOOKUP_CREATE)) &&
> > + path->dentry->d_inode)
> > + return -EISDIR;
> > + }
> > current->total_link_count++;
> > if (current->total_link_count >= 40)
> > return -ELOOP;
> >
> >
> >
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [22/27] VFS: Fix automount for negative autofs dentries
2011-10-23 11:48 ` Greg KH
@ 2011-10-23 12:07 ` Ian Kent
0 siblings, 0 replies; 37+ messages in thread
From: Ian Kent @ 2011-10-23 12:07 UTC (permalink / raw)
To: Greg KH
Cc: Greg KH, linux-kernel, stable, stable-review, torvalds, akpm,
alan, David Howells, Al Viro, Chuck Ebbert
On Sun, 2011-10-23 at 13:48 +0200, Greg KH wrote:
> On Sun, Oct 23, 2011 at 07:41:18PM +0800, Ian Kent wrote:
> > On Sun, 2011-10-23 at 08:24 +0200, Greg KH wrote:
> > > 3.0-stable review patch. If anyone has any objections, please let us know.
> >
> > Yes, as others point out, either the patch needs to be correctly
> > backported or the dependent patches need to be pulled in.
> >
> > I can do either of these, what would you prefer?
>
> I'd prefer to take the dependant patches, as that would make things sync
> up with what is in Linus's tree, I just wanted to get Miklos's and
> David's acks that this is the way to go before I did it.
Sure, just let me know if you want me to do any of the leg work (or
keyboard work in this case, ;)).
Ian
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [22/27] VFS: Fix automount for negative autofs dentries
2011-10-23 8:36 ` Greg KH
@ 2011-10-23 21:09 ` Miklos Szeredi
2011-10-24 14:22 ` Greg KH
2011-11-01 15:51 ` David Howells
1 sibling, 1 reply; 37+ messages in thread
From: Miklos Szeredi @ 2011-10-23 21:09 UTC (permalink / raw)
To: Greg KH
Cc: Linus Torvalds, David Howells, linux-kernel, stable,
stable-review, akpm, alan, Ian Kent, Al Viro, Chuck Ebbert,
Trond Myklebust
Greg KH <gregkh@suse.de> writes:
> On Sun, Oct 23, 2011 at 10:35:14AM +0300, Linus Torvalds wrote:
>> This one is debatable.
>>
>> I think it also wants
>>
>> - commit 0ec26fd0698285b31248e34bf1abb022c00f23d6 (with
>> LOOKUP_PARENT->LOOKUP_CONTINUE too)
>
> Really? I thought I dropped this one from the last stable release due
> to problems with it, or does this patch here, and the one you mention
> below, resolve those issues?
>
>> - commit d94c177beeb4469cd4f6e83354ab0223353e98ed (to get the few
>> other cases right too)
>>
>> anything else I missed?
>
> Ok, that makes a bit more sense, I'll add these if David and Miklos
> agree that they are ok to add here. David and Miklos?
IMO they are OK to add as long as they are both added.
Last time the first one had to be backed out because Linus wasn't
totally comfortable with the other one going into -stable until it got
some testing in 3.1. Or at least that's how I understood (or
misunderstood).
Thanks,
Miklos
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [22/27] VFS: Fix automount for negative autofs dentries
2011-10-23 21:09 ` Miklos Szeredi
@ 2011-10-24 14:22 ` Greg KH
0 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2011-10-24 14:22 UTC (permalink / raw)
To: Miklos Szeredi
Cc: Greg KH, Linus Torvalds, David Howells, linux-kernel, stable,
stable-review, akpm, alan, Ian Kent, Al Viro, Chuck Ebbert,
Trond Myklebust
On Sun, Oct 23, 2011 at 11:09:11PM +0200, Miklos Szeredi wrote:
> Greg KH <gregkh@suse.de> writes:
>
> > On Sun, Oct 23, 2011 at 10:35:14AM +0300, Linus Torvalds wrote:
> >> This one is debatable.
> >>
> >> I think it also wants
> >>
> >> - commit 0ec26fd0698285b31248e34bf1abb022c00f23d6 (with
> >> LOOKUP_PARENT->LOOKUP_CONTINUE too)
> >
> > Really? I thought I dropped this one from the last stable release due
> > to problems with it, or does this patch here, and the one you mention
> > below, resolve those issues?
> >
> >> - commit d94c177beeb4469cd4f6e83354ab0223353e98ed (to get the few
> >> other cases right too)
> >>
> >> anything else I missed?
> >
> > Ok, that makes a bit more sense, I'll add these if David and Miklos
> > agree that they are ok to add here. David and Miklos?
>
> IMO they are OK to add as long as they are both added.
>
> Last time the first one had to be backed out because Linus wasn't
> totally comfortable with the other one going into -stable until it got
> some testing in 3.1. Or at least that's how I understood (or
> misunderstood).
Ok, I tried applying these patches, but they didn't apply. I tried
digging the patches out of the suse kernel tree, but they didn't seem to
include all of the needed ones here.
So, I'm going to drop this patch from the 3.0.8 release, can someone
please send me the needed patches, backported to 3.0, so that I know
they are working properly?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [22/27] VFS: Fix automount for negative autofs dentries
2011-10-23 8:36 ` Greg KH
2011-10-23 21:09 ` Miklos Szeredi
@ 2011-11-01 15:51 ` David Howells
1 sibling, 0 replies; 37+ messages in thread
From: David Howells @ 2011-11-01 15:51 UTC (permalink / raw)
To: Greg KH
Cc: dhowells, Linus Torvalds, Miklos Szeredi, linux-kernel, stable,
stable-review, akpm, alan, Ian Kent, Al Viro, Chuck Ebbert,
Trond Myklebust
Greg KH <gregkh@suse.de> wrote:
> Ok, that makes a bit more sense, I'll add these if David and Miklos
> agree that they are ok to add here. David and Miklos?
Sure.
David
^ permalink raw reply [flat|nested] 37+ messages in thread
end of thread, other threads:[~2011-11-01 15:53 UTC | newest]
Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-23 6:28 [00/27] 3.0.8-stable review Greg KH
2011-10-23 6:24 ` [01/27] ARM: 7113/1: mm: Align bank start to MAX_ORDER_NR_PAGES Greg KH
2011-10-23 6:24 ` [02/27] ARM: 7117/1: perf: fix HW_CACHE_* events on Cortex-A9 Greg KH
2011-10-23 6:24 ` [03/27] HID: usbhid: Add support for SiGma Micro chip Greg KH
2011-10-23 6:24 ` [04/27] hwmon: (w83627ehf) Properly report thermal diode sensors Greg KH
2011-10-23 6:24 ` [05/27] Avoid using variable-length arrays in kernel/sys.c Greg KH
2011-10-23 6:24 ` [06/27] drm/radeon/kms/atom: fix handling of FB scratch indices Greg KH
2011-10-23 6:24 ` [07/27] cputimer: Cure lock inversion Greg KH
2011-10-23 6:24 ` [08/27] fuse: fix memory leak Greg KH
2011-10-23 6:24 ` [09/27] Platform: fix samsung-laptop DMI identification for N150/N210/220/N230 Greg KH
2011-10-23 6:24 ` [10/27] HID: magicmouse: ignore ivalid report id while switching modes, v2 Greg KH
2011-10-23 6:24 ` [11/27] [media] uvcvideo: Fix crash when linking entities Greg KH
2011-10-23 6:24 ` [12/27] hfsplus: ensure bio requests are not smaller than the hardware sectors Greg KH
2011-10-23 6:24 ` [13/27] drm/ttm: ensure ttm for new node is bound before calling move_notify() Greg KH
2011-10-23 6:24 ` [14/27] drm/ttm: unbind ttm before destroying node in accel move cleanup Greg KH
2011-10-23 6:24 ` [15/27] CIFS: Fix ERR_PTR dereference in cifs_get_root Greg KH
2011-10-23 6:24 ` [16/27] xfs: start periodic workers later Greg KH
2011-10-23 6:24 ` [17/27] xfs: use a cursor for bulk AIL insertion Greg KH
2011-10-23 6:24 ` [18/27] xfs: do not update xa_last_pushed_lsn for locked items Greg KH
2011-10-23 6:24 ` [19/27] xfs: force the log if we encounter pinned buffers in .iop_pushbuf Greg KH
2011-10-23 6:24 ` [20/27] xfs: revert to using a kthread for AIL pushing Greg KH
2011-10-23 6:24 ` [21/27] firewire: sbp2: fix panic after rmmod with slow targets Greg KH
2011-10-23 6:24 ` [22/27] VFS: Fix automount for negative autofs dentries Greg KH
2011-10-23 7:35 ` Linus Torvalds
2011-10-23 8:36 ` Greg KH
2011-10-23 21:09 ` Miklos Szeredi
2011-10-24 14:22 ` Greg KH
2011-11-01 15:51 ` David Howells
2011-10-23 11:59 ` Ian Kent
2011-10-23 11:41 ` Ian Kent
2011-10-23 11:48 ` Greg KH
2011-10-23 12:07 ` Ian Kent
2011-10-23 6:24 ` [23/27] mm: fix race between mremap and removing migration entry Greg KH
2011-10-23 6:24 ` [24/27] x25: Prevent skb overreads when checking call user data Greg KH
2011-10-23 6:24 ` [25/27] crypto: ghash - Avoid null pointer dereference if no key is set Greg KH
2011-10-23 6:24 ` [26/27] ALSA: HDA: conexant support for Lenovo T520/W520 Greg KH
2011-10-23 6:24 ` [27/27] ALSA: hda - Add position_fix quirk for Dell Inspiron 1010 Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).