]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.7-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Jan 2013 19:38:10 +0000 (11:38 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Jan 2013 19:38:10 +0000 (11:38 -0800)
added patches:
aoe-remove-vestigial-request-queue-allocation.patch
udf-don-t-increment-lenextents-while-writing-to-a-hole.patch
udf-fix-memory-leak-while-allocating-blocks-during-write.patch

queue-3.7/aoe-remove-vestigial-request-queue-allocation.patch [new file with mode: 0644]
queue-3.7/series
queue-3.7/udf-don-t-increment-lenextents-while-writing-to-a-hole.patch [new file with mode: 0644]
queue-3.7/udf-fix-memory-leak-while-allocating-blocks-during-write.patch [new file with mode: 0644]

diff --git a/queue-3.7/aoe-remove-vestigial-request-queue-allocation.patch b/queue-3.7/aoe-remove-vestigial-request-queue-allocation.patch
new file mode 100644 (file)
index 0000000..07aebd2
--- /dev/null
@@ -0,0 +1,70 @@
+From 0a41409c518083133e79015092585d68915865be Mon Sep 17 00:00:00 2001
+From: Ed Cashin <ecashin@coraid.com>
+Date: Mon, 17 Dec 2012 16:03:58 -0800
+Subject: aoe: remove vestigial request queue allocation
+
+From: Ed Cashin <ecashin@coraid.com>
+
+commit 0a41409c518083133e79015092585d68915865be upstream.
+
+Before the aoe driver was an I/O request handler, it was a
+make_request-style block driver.  Even so, there was a problem where
+sysfs expected a request queue to exist, so one was provided in commit
+7135a71b19be ("aoe: allocate unused request_queue for sysfs").
+
+During the transition to the request-handler style, a patch was merged
+that was based on a driver without the noop queue, and the noop queue
+remained in place after the patch was merged, even though a new
+functional queue was introduced by the patch, allocated through
+blk_init_queue.
+
+The user impact is a memory leak proportional to the number of AoE
+targets discovered.  This patch removes the memory leak and cleans up
+vestiges of the old do-nothing queue from the aoeblk_gdalloc function.
+
+Signed-off-by: Ed Cashin <ecashin@coraid.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/block/aoe/aoeblk.c |   17 ++++-------------
+ 1 file changed, 4 insertions(+), 13 deletions(-)
+
+--- a/drivers/block/aoe/aoeblk.c
++++ b/drivers/block/aoe/aoeblk.c
+@@ -231,18 +231,12 @@ aoeblk_gdalloc(void *vp)
+       if (q == NULL) {
+               pr_err("aoe: cannot allocate block queue for %ld.%d\n",
+                       d->aoemajor, d->aoeminor);
+-              mempool_destroy(mp);
+-              goto err_disk;
++              goto err_mempool;
+       }
+-      d->blkq = blk_alloc_queue(GFP_KERNEL);
+-      if (!d->blkq)
+-              goto err_mempool;
+-      d->blkq->backing_dev_info.name = "aoe";
+-      if (bdi_init(&d->blkq->backing_dev_info))
+-              goto err_blkq;
+       spin_lock_irqsave(&d->lock, flags);
+-      blk_queue_max_hw_sectors(d->blkq, BLK_DEF_MAX_SECTORS);
++      blk_queue_max_hw_sectors(q, BLK_DEF_MAX_SECTORS);
++      q->backing_dev_info.name = "aoe";
+       q->backing_dev_info.ra_pages = READ_AHEAD / PAGE_CACHE_SIZE;
+       d->bufpool = mp;
+       d->blkq = gd->queue = q;
+@@ -265,11 +259,8 @@ aoeblk_gdalloc(void *vp)
+       aoedisk_add_sysfs(d);
+       return;
+-err_blkq:
+-      blk_cleanup_queue(d->blkq);
+-      d->blkq = NULL;
+ err_mempool:
+-      mempool_destroy(d->bufpool);
++      mempool_destroy(mp);
+ err_disk:
+       put_disk(gd);
+ err:
index 268d091871b6956925deab440b130d755100f34a..1d2480c98adf6af1566e7aad05262099f35ef495 100644 (file)
@@ -113,3 +113,6 @@ ext4-do-not-try-to-write-superblock-on-ro-remount-w-o-journal.patch
 ext4-lock-i_mutex-when-truncating-orphan-inodes.patch
 ext4-avoid-hang-when-mounting-non-journal-filesystems-with-orphan-list.patch
 ext4-release-buffer-in-failed-path-in-dx_probe.patch
+aoe-remove-vestigial-request-queue-allocation.patch
+udf-fix-memory-leak-while-allocating-blocks-during-write.patch
+udf-don-t-increment-lenextents-while-writing-to-a-hole.patch
diff --git a/queue-3.7/udf-don-t-increment-lenextents-while-writing-to-a-hole.patch b/queue-3.7/udf-don-t-increment-lenextents-while-writing-to-a-hole.patch
new file mode 100644 (file)
index 0000000..c3f13d3
--- /dev/null
@@ -0,0 +1,61 @@
+From fb719c59bdb4fca86ee1fd1f42ab3735ca12b6b2 Mon Sep 17 00:00:00 2001
+From: Namjae Jeon <namjae.jeon@samsung.com>
+Date: Wed, 10 Oct 2012 00:09:12 +0900
+Subject: udf: don't increment lenExtents while writing to a hole
+
+From: Namjae Jeon <namjae.jeon@samsung.com>
+
+commit fb719c59bdb4fca86ee1fd1f42ab3735ca12b6b2 upstream.
+
+Incrementing lenExtents even while writing to a hole is bad
+for performance as calls to udf_discard_prealloc and
+udf_truncate_tail_extent would not return from start if
+isize != lenExtents
+
+Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
+Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Shuah Khan <shuah.khan@hp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/udf/inode.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/fs/udf/inode.c
++++ b/fs/udf/inode.c
+@@ -601,6 +601,7 @@ static sector_t inode_getblk(struct inod
+       struct udf_inode_info *iinfo = UDF_I(inode);
+       int goal = 0, pgoal = iinfo->i_location.logicalBlockNum;
+       int lastblock = 0;
++      bool isBeyondEOF;
+       *err = 0;
+       *new = 0;
+@@ -680,7 +681,7 @@ static sector_t inode_getblk(struct inod
+       /* Are we beyond EOF? */
+       if (etype == -1) {
+               int ret;
+-
++              isBeyondEOF = 1;
+               if (count) {
+                       if (c)
+                               laarr[0] = laarr[1];
+@@ -723,6 +724,7 @@ static sector_t inode_getblk(struct inod
+               endnum = c + 1;
+               lastblock = 1;
+       } else {
++              isBeyondEOF = 0;
+               endnum = startnum = ((count > 2) ? 2 : count);
+               /* if the current extent is in position 0,
+@@ -770,7 +772,8 @@ static sector_t inode_getblk(struct inod
+                       *err = -ENOSPC;
+                       return 0;
+               }
+-              iinfo->i_lenExtents += inode->i_sb->s_blocksize;
++              if (isBeyondEOF)
++                      iinfo->i_lenExtents += inode->i_sb->s_blocksize;
+       }
+       /* if the extent the requsted block is located in contains multiple
diff --git a/queue-3.7/udf-fix-memory-leak-while-allocating-blocks-during-write.patch b/queue-3.7/udf-fix-memory-leak-while-allocating-blocks-during-write.patch
new file mode 100644 (file)
index 0000000..ec69df3
--- /dev/null
@@ -0,0 +1,41 @@
+From 2fb7d99d0de3fd8ae869f35ab682581d8455887a Mon Sep 17 00:00:00 2001
+From: Namjae Jeon <namjae.jeon@samsung.com>
+Date: Wed, 10 Oct 2012 00:08:56 +0900
+Subject: udf: fix memory leak while allocating blocks during write
+
+From: Namjae Jeon <namjae.jeon@samsung.com>
+
+commit 2fb7d99d0de3fd8ae869f35ab682581d8455887a upstream.
+
+Need to brelse the buffer_head stored in cur_epos and next_epos.
+
+Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
+Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Shuah Khan <shuah.khan@hp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/udf/inode.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/fs/udf/inode.c
++++ b/fs/udf/inode.c
+@@ -765,6 +765,8 @@ static sector_t inode_getblk(struct inod
+                               goal, err);
+               if (!newblocknum) {
+                       brelse(prev_epos.bh);
++                      brelse(cur_epos.bh);
++                      brelse(next_epos.bh);
+                       *err = -ENOSPC;
+                       return 0;
+               }
+@@ -795,6 +797,8 @@ static sector_t inode_getblk(struct inod
+       udf_update_extents(inode, laarr, startnum, endnum, &prev_epos);
+       brelse(prev_epos.bh);
++      brelse(cur_epos.bh);
++      brelse(next_epos.bh);
+       newblock = udf_get_pblock(inode->i_sb, newblocknum,
+                               iinfo->i_location.partitionReferenceNum, 0);