]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.2-stable patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 16 Jan 2012 19:04:20 +0000 (11:04 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 16 Jan 2012 19:04:20 +0000 (11:04 -0800)
added patches:
ubi-fix-debugging-messages.patch
ubi-fix-nameless-volumes-handling.patch
ubifs-fix-debugging-messages.patch
ubifs-make-debugging-messages-light-again.patch
ubi-make-vid_hdr-non-static.patch

queue-3.2/series
queue-3.2/ubi-fix-debugging-messages.patch [new file with mode: 0644]
queue-3.2/ubi-fix-nameless-volumes-handling.patch [new file with mode: 0644]
queue-3.2/ubi-make-vid_hdr-non-static.patch [new file with mode: 0644]
queue-3.2/ubifs-fix-debugging-messages.patch [new file with mode: 0644]
queue-3.2/ubifs-make-debugging-messages-light-again.patch [new file with mode: 0644]

index e5c29e9f153feed4cbb674fe3b26ac664b388bb0..fa6aa351574819d3870c0abccd0b9931fbf57124 100644 (file)
@@ -49,3 +49,8 @@ mac80211-fix-rx-key-null-pointer-dereference-in-promiscuous-mode.patch
 ath9k-fix-regression-in-channelwidth-switch-at-the-same-channel.patch
 memcg-add-mem_cgroup_replace_page_cache-to-fix-lru-issue.patch
 x86-fix-mmap-random-address-range.patch
+ubi-fix-nameless-volumes-handling.patch
+ubi-fix-debugging-messages.patch
+ubi-make-vid_hdr-non-static.patch
+ubifs-fix-debugging-messages.patch
+ubifs-make-debugging-messages-light-again.patch
diff --git a/queue-3.2/ubi-fix-debugging-messages.patch b/queue-3.2/ubi-fix-debugging-messages.patch
new file mode 100644 (file)
index 0000000..9cf77e4
--- /dev/null
@@ -0,0 +1,40 @@
+From 72f0d453d81d35087b1d3ad7c8285628c2be6e1d Mon Sep 17 00:00:00 2001
+From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
+Date: Tue, 10 Jan 2012 19:32:30 +0200
+Subject: UBI: fix debugging messages
+
+From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
+
+commit 72f0d453d81d35087b1d3ad7c8285628c2be6e1d upstream.
+
+Patch ab50ff684707031ed4bad2fdd313208ae392e5bb broke UBI debugging messages:
+before that commit when UBI debugging was enabled, users saw few useful
+debugging messages after attaching an MTD device. However, that patch turned
+'dbg_msg()' into 'pr_debug()', so to enable the debugging messages users have
+to enable them first via /sys/kernel/debug/dynamic_debug/control, which is
+very impractical.
+
+This commit makes 'dbg_msg()' to use 'printk()' instead of 'pr_debug()', just
+as it was before the breakage.
+
+Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/mtd/ubi/debug.h |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/mtd/ubi/debug.h
++++ b/drivers/mtd/ubi/debug.h
+@@ -43,7 +43,10 @@
+       pr_debug("UBI DBG " type ": " fmt "\n", ##__VA_ARGS__)
+ /* Just a debugging messages not related to any specific UBI subsystem */
+-#define dbg_msg(fmt, ...) ubi_dbg_msg("msg", fmt, ##__VA_ARGS__)
++#define dbg_msg(fmt, ...)                                    \
++      printk(KERN_DEBUG "UBI DBG (pid %d): %s: " fmt "\n", \
++             current->pid, __func__, ##__VA_ARGS__)
++
+ /* General debugging messages */
+ #define dbg_gen(fmt, ...) ubi_dbg_msg("gen", fmt, ##__VA_ARGS__)
+ /* Messages from the eraseblock association sub-system */
diff --git a/queue-3.2/ubi-fix-nameless-volumes-handling.patch b/queue-3.2/ubi-fix-nameless-volumes-handling.patch
new file mode 100644 (file)
index 0000000..d412c6e
--- /dev/null
@@ -0,0 +1,35 @@
+From 4a59c797a18917a5cf3ff7ade296b46134d91e6a Mon Sep 17 00:00:00 2001
+From: Richard Weinberger <richard@nod.at>
+Date: Fri, 13 Jan 2012 15:07:40 +0100
+Subject: UBI: fix nameless volumes handling
+
+From: Richard Weinberger <richard@nod.at>
+
+commit 4a59c797a18917a5cf3ff7ade296b46134d91e6a upstream.
+
+Currently it's possible to create a volume without a name. E.g:
+ubimkvol -n 32 -s 2MiB -t static /dev/ubi0 -N ""
+
+After that vtbl_check() will always fail because it does not permit
+empty strings.
+
+Signed-off-by: Richard Weinberger <richard@nod.at>
+Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/mtd/ubi/cdev.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/mtd/ubi/cdev.c
++++ b/drivers/mtd/ubi/cdev.c
+@@ -632,6 +632,9 @@ static int verify_mkvol_req(const struct
+       if (req->alignment != 1 && n)
+               goto bad;
++      if (!req->name[0] || !req->name_len)
++              goto bad;
++
+       if (req->name_len > UBI_VOL_NAME_MAX) {
+               err = -ENAMETOOLONG;
+               goto bad;
diff --git a/queue-3.2/ubi-make-vid_hdr-non-static.patch b/queue-3.2/ubi-make-vid_hdr-non-static.patch
new file mode 100644 (file)
index 0000000..6a786d4
--- /dev/null
@@ -0,0 +1,34 @@
+From 6bdccffe8c4268d02f71873102131fb6ed37ed9a Mon Sep 17 00:00:00 2001
+From: Richard Weinberger <rw@linutronix.de>
+Date: Thu, 22 Dec 2011 16:12:57 +0100
+Subject: UBI: make vid_hdr non-static
+
+From: Richard Weinberger <rw@linutronix.de>
+
+commit 6bdccffe8c4268d02f71873102131fb6ed37ed9a upstream.
+
+Remove 'static' modifier from the 'vid_hdr' local variable. I do not know
+how it slipped in, but this is a bug and will break UBI if someone attaches
+2 UBI volumes at the same time.
+
+Artem: amended teh commit message, added -stable.
+
+Signed-off-by: Richard Weinberger <rw@linutronix.de>
+Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/mtd/ubi/vtbl.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/mtd/ubi/vtbl.c
++++ b/drivers/mtd/ubi/vtbl.c
+@@ -306,7 +306,7 @@ static int create_vtbl(struct ubi_device
+                      int copy, void *vtbl)
+ {
+       int err, tries = 0;
+-      static struct ubi_vid_hdr *vid_hdr;
++      struct ubi_vid_hdr *vid_hdr;
+       struct ubi_scan_leb *new_seb;
+       ubi_msg("create volume table (copy #%d)", copy + 1);
diff --git a/queue-3.2/ubifs-fix-debugging-messages.patch b/queue-3.2/ubifs-fix-debugging-messages.patch
new file mode 100644 (file)
index 0000000..3048ae8
--- /dev/null
@@ -0,0 +1,39 @@
+From d34315da9146253351146140ea4b277193ee5e5f Mon Sep 17 00:00:00 2001
+From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
+Date: Tue, 10 Jan 2012 19:32:30 +0200
+Subject: UBIFS: fix debugging messages
+
+From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
+
+commit d34315da9146253351146140ea4b277193ee5e5f upstream.
+
+Patch 56e46742e846e4de167dde0e1e1071ace1c882a5 broke UBIFS debugging messages:
+before that commit when UBIFS debugging was enabled, users saw few useful
+debugging messages after mount. However, that patch turned 'dbg_msg()' into
+'pr_debug()', so to enable the debugging messages users have to enable them
+first via /sys/kernel/debug/dynamic_debug/control, which is very impractical.
+
+This commit makes 'dbg_msg()' to use 'printk()' instead of 'pr_debug()', just
+as it was before the breakage.
+
+Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/ubifs/debug.h |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/fs/ubifs/debug.h
++++ b/fs/ubifs/debug.h
+@@ -190,7 +190,10 @@ extern spinlock_t dbg_lock;
+ } while (0)
+ /* Just a debugging messages not related to any specific UBIFS subsystem */
+-#define dbg_msg(fmt, ...)   ubifs_dbg_msg("msg", fmt, ##__VA_ARGS__)
++#define dbg_msg(fmt, ...)                                                     \
++      printk(KERN_DEBUG "UBIFS DBG (pid %d): %s: " fmt "\n", current->pid,  \
++             __func__, ##__VA_ARGS__)
++
+ /* General messages */
+ #define dbg_gen(fmt, ...)   ubifs_dbg_msg("gen", fmt, ##__VA_ARGS__)
+ /* Additional journal messages */
diff --git a/queue-3.2/ubifs-make-debugging-messages-light-again.patch b/queue-3.2/ubifs-make-debugging-messages-light-again.patch
new file mode 100644 (file)
index 0000000..eff6d69
--- /dev/null
@@ -0,0 +1,55 @@
+From 1f5d78dc4823a85f112aaa2d0f17624f8c2a6c52 Mon Sep 17 00:00:00 2001
+From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
+Date: Wed, 11 Jan 2012 15:13:27 +0200
+Subject: UBIFS: make debugging messages light again
+
+From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
+
+commit 1f5d78dc4823a85f112aaa2d0f17624f8c2a6c52 upstream.
+
+We switch to dynamic debugging in commit
+56e46742e846e4de167dde0e1e1071ace1c882a5 but did not take into account that
+now we do not control anymore whether a specific message is enabled or not.
+So now we lock the "dbg_lock" and release it in every debugging macro, which
+make them not so light-weight.
+
+This commit removes the "dbg_lock" protection from the debugging macros to
+fix the issue.
+
+The downside is that now our DBGKEY() stuff is broken, but this is not
+critical at all and will be fixed later.
+
+Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/ubifs/debug.h |   12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
+
+--- a/fs/ubifs/debug.h
++++ b/fs/ubifs/debug.h
+@@ -175,19 +175,17 @@ const char *dbg_key_str1(const struct ub
+                        const union ubifs_key *key);
+ /*
+- * DBGKEY macros require @dbg_lock to be held, which it is in the dbg message
+- * macros.
++ * TODO: these macros are now broken because there is no locking around them
++ * and we use a global buffer for the key string. This means that in case of
++ * concurrent execution we will end up with incorrect and messy key strings.
+  */
+ #define DBGKEY(key) dbg_key_str0(c, (key))
+ #define DBGKEY1(key) dbg_key_str1(c, (key))
+ extern spinlock_t dbg_lock;
+-#define ubifs_dbg_msg(type, fmt, ...) do {                        \
+-      spin_lock(&dbg_lock);                                     \
+-      pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__); \
+-      spin_unlock(&dbg_lock);                                   \
+-} while (0)
++#define ubifs_dbg_msg(type, fmt, ...) \
++      pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__)
+ /* Just a debugging messages not related to any specific UBIFS subsystem */
+ #define dbg_msg(fmt, ...)                                                     \