From: Greg Kroah-Hartman Date: Fri, 29 Nov 2013 21:06:53 +0000 (-0800) Subject: 3.4-stable patches X-Git-Tag: v3.4.72~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75fe20060ca004eaec5daaa4e67c945db21809df;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: alarmtimer-return-einval-instead-of-enotsupp-if-rtcdev-doesn-t-exist.patch devpts-plug-the-memory-leak-in-kill_sb.patch --- diff --git a/queue-3.4/alarmtimer-return-einval-instead-of-enotsupp-if-rtcdev-doesn-t-exist.patch b/queue-3.4/alarmtimer-return-einval-instead-of-enotsupp-if-rtcdev-doesn-t-exist.patch new file mode 100644 index 00000000000..20b32d71ca9 --- /dev/null +++ b/queue-3.4/alarmtimer-return-einval-instead-of-enotsupp-if-rtcdev-doesn-t-exist.patch @@ -0,0 +1,60 @@ +From 98d6f4dd84a134d942827584a3c5f67ffd8ec35f Mon Sep 17 00:00:00 2001 +From: KOSAKI Motohiro +Date: Mon, 14 Oct 2013 17:33:16 -0400 +Subject: alarmtimer: return EINVAL instead of ENOTSUPP if rtcdev doesn't exist + +From: KOSAKI Motohiro + +commit 98d6f4dd84a134d942827584a3c5f67ffd8ec35f upstream. + +Fedora Ruby maintainer reported latest Ruby doesn't work on Fedora Rawhide +on ARM. (http://bugs.ruby-lang.org/issues/9008) + +Because of, commit 1c6b39ad3f (alarmtimers: Return -ENOTSUPP if no +RTC device is present) intruduced to return ENOTSUPP when +clock_get{time,res} can't find a RTC device. However this is incorrect. + +First, ENOTSUPP isn't exported to userland (ENOTSUP or EOPNOTSUP are the +closest userland equivlents). + +Second, Posix and Linux man pages agree that clock_gettime and +clock_getres should return EINVAL if clk_id argument is invalid. +While the arugment that the clockid is valid, but just not supported +on this hardware could be made, this is just a technicality that +doesn't help userspace applicaitons, and only complicates error +handling. + +Thus, this patch changes the code to use EINVAL. + +Cc: Thomas Gleixner +Cc: Frederic Weisbecker +Reported-by: Vit Ondruch +Signed-off-by: KOSAKI Motohiro +[jstultz: Tweaks to commit message to include full rational] +Signed-off-by: John Stultz +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/time/alarmtimer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/time/alarmtimer.c ++++ b/kernel/time/alarmtimer.c +@@ -474,7 +474,7 @@ static int alarm_clock_getres(const cloc + clockid_t baseid = alarm_bases[clock2alarm(which_clock)].base_clockid; + + if (!alarmtimer_get_rtcdev()) +- return -ENOTSUPP; ++ return -EINVAL; + + return hrtimer_get_res(baseid, tp); + } +@@ -491,7 +491,7 @@ static int alarm_clock_get(clockid_t whi + struct alarm_base *base = &alarm_bases[clock2alarm(which_clock)]; + + if (!alarmtimer_get_rtcdev()) +- return -ENOTSUPP; ++ return -EINVAL; + + *tp = ktime_to_timespec(base->gettime()); + return 0; diff --git a/queue-3.4/devpts-plug-the-memory-leak-in-kill_sb.patch b/queue-3.4/devpts-plug-the-memory-leak-in-kill_sb.patch new file mode 100644 index 00000000000..734a98c6753 --- /dev/null +++ b/queue-3.4/devpts-plug-the-memory-leak-in-kill_sb.patch @@ -0,0 +1,38 @@ +From 66da0e1f9034140ae2f571ef96e254a25083906c Mon Sep 17 00:00:00 2001 +From: Ilija Hadzic +Date: Tue, 12 Nov 2013 15:11:45 -0800 +Subject: devpts: plug the memory leak in kill_sb + +From: Ilija Hadzic + +commit 66da0e1f9034140ae2f571ef96e254a25083906c upstream. + +When devpts is unmounted, there may be a no-longer-used IDR tree hanging +off the superblock we are about to kill. This needs to be cleaned up +before destroying the SB. + +The leak is usually not a big deal because unmounting devpts is typically +done when shutting down the whole machine. However, shutting down an LXC +container instead of a physical machine exposes the problem (the garbage +is detectable with kmemleak). + +Signed-off-by: Ilija Hadzic +Cc: Sukadev Bhattiprolu +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/devpts/inode.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/fs/devpts/inode.c ++++ b/fs/devpts/inode.c +@@ -475,6 +475,7 @@ static void devpts_kill_sb(struct super_ + { + struct pts_fs_info *fsi = DEVPTS_SB(sb); + ++ ida_destroy(&fsi->allocated_ptys); + kfree(fsi); + kill_litter_super(sb); + } diff --git a/queue-3.4/series b/queue-3.4/series index f5d1bbe8398..19f1bb75098 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -5,3 +5,5 @@ backlight-atmel-pwm-bl-fix-reported-brightness.patch asoc-ak4642-prevent-un-necessary-changes-to-sg_sl1.patch asoc-wm8962-turn-on-regcache_cache_only-before-disabling-regulator.patch asoc-blackfin-fix-missing-break.patch +alarmtimer-return-einval-instead-of-enotsupp-if-rtcdev-doesn-t-exist.patch +devpts-plug-the-memory-leak-in-kill_sb.patch