From: Greg Kroah-Hartman Date: Thu, 15 Dec 2011 23:54:21 +0000 (-0800) Subject: 3.1 patches X-Git-Tag: v3.0.14~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cccf1b956fdd63eaee7ba163c18ecaa482c476b0;p=thirdparty%2Fkernel%2Fstable-queue.git 3.1 patches added patches: drm-radeon-kms-add-some-new-pci-ids.patch ext4-avoid-hangs-in-ext4_da_should_update_i_disksize.patch ext4-avoid-potential-hang-in-mpage_submit_io-when-blocksize-pagesize.patch ext4-display-the-correct-mount-option-in-proc-mounts-for-init_itable.patch ext4-fix-ext4_end_io_dio-racing-against-fsync.patch ext4-handle-eof-correctly-in-ext4_bio_write_page.patch fuse-fix-fuse_retrieve.patch fuse-fix-llseek-bug.patch staging-r8712u-add-new-usb-id.patch xen-only-limit-memory-map-to-maximum-reservation-for-domain-0.patch --- diff --git a/queue-3.1/drm-radeon-kms-add-some-new-pci-ids.patch b/queue-3.1/drm-radeon-kms-add-some-new-pci-ids.patch new file mode 100644 index 00000000000..6305a2ecb11 --- /dev/null +++ b/queue-3.1/drm-radeon-kms-add-some-new-pci-ids.patch @@ -0,0 +1,71 @@ +From cd5cfce856684e13b9b57d46b78bb827e9c4da3c Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 12 Dec 2011 09:23:48 -0500 +Subject: drm/radeon/kms: add some new pci ids + +From: Alex Deucher + +commit cd5cfce856684e13b9b57d46b78bb827e9c4da3c upstream. + +Fixes: +https://bugs.freedesktop.org/show_bug.cgi?id=43739 + +Signed-off-by: Alex Deucher +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + include/drm/drm_pciids.h | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/include/drm/drm_pciids.h ++++ b/include/drm/drm_pciids.h +@@ -182,8 +182,11 @@ + {0x1002, 0x6748, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6749, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ ++ {0x1002, 0x6751, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6759, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ ++ {0x1002, 0x675B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ ++ {0x1002, 0x675D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x675F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ +@@ -195,8 +198,10 @@ + {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ ++ {0x1002, 0x6772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6778, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ ++ {0x1002, 0x677B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6840, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6841, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x6842, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ +@@ -246,6 +251,7 @@ + {0x1002, 0x68f2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x68f8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x68f9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ ++ {0x1002, 0x68fa, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x68fe, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x7100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R520|RADEON_NEW_MEMMAP}, \ + {0x1002, 0x7101, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R520|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ +@@ -488,6 +494,8 @@ + {0x1002, 0x9647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ + {0x1002, 0x9648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ + {0x1002, 0x964a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ ++ {0x1002, 0x964b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ ++ {0x1002, 0x964c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ + {0x1002, 0x964e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ + {0x1002, 0x964f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ + {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +@@ -502,6 +510,8 @@ + {0x1002, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ + {0x1002, 0x9806, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ + {0x1002, 0x9807, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ ++ {0x1002, 0x9808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ ++ {0x1002, 0x9809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ + {0, 0, 0} + + #define r128_PCI_IDS \ diff --git a/queue-3.1/ext4-avoid-hangs-in-ext4_da_should_update_i_disksize.patch b/queue-3.1/ext4-avoid-hangs-in-ext4_da_should_update_i_disksize.patch new file mode 100644 index 00000000000..eb72f3564a2 --- /dev/null +++ b/queue-3.1/ext4-avoid-hangs-in-ext4_da_should_update_i_disksize.patch @@ -0,0 +1,93 @@ +From ea51d132dbf9b00063169c1159bee253d9649224 Mon Sep 17 00:00:00 2001 +From: Andrea Arcangeli +Date: Tue, 13 Dec 2011 21:41:15 -0500 +Subject: ext4: avoid hangs in ext4_da_should_update_i_disksize() + +From: Andrea Arcangeli + +commit ea51d132dbf9b00063169c1159bee253d9649224 upstream. + +If the pte mapping in generic_perform_write() is unmapped between +iov_iter_fault_in_readable() and iov_iter_copy_from_user_atomic(), the +"copied" parameter to ->end_write can be zero. ext4 couldn't cope with +it with delayed allocations enabled. This skips the i_disksize +enlargement logic if copied is zero and no new data was appeneded to +the inode. + + gdb> bt + #0 0xffffffff811afe80 in ext4_da_should_update_i_disksize (file=0xffff88003f606a80, mapping=0xffff88001d3824e0, pos=0x1\ + 08000, len=0x1000, copied=0x0, page=0xffffea0000d792e8, fsdata=0x0) at fs/ext4/inode.c:2467 + #1 ext4_da_write_end (file=0xffff88003f606a80, mapping=0xffff88001d3824e0, pos=0x108000, len=0x1000, copied=0x0, page=0\ + xffffea0000d792e8, fsdata=0x0) at fs/ext4/inode.c:2512 + #2 0xffffffff810d97f1 in generic_perform_write (iocb=, iov=, nr_segs=, pos=0x108000, ppos=0xffff88001e26be40, count=, written=0x0) at mm/filemap.c:2440 + #3 generic_file_buffered_write (iocb=, iov=, nr_segs=, p\ + os=0x108000, ppos=0xffff88001e26be40, count=, written=0x0) at mm/filemap.c:2482 + #4 0xffffffff810db5d1 in __generic_file_aio_write (iocb=0xffff88001e26bde8, iov=0xffff88001e26bec8, nr_segs=0x1, ppos=0\ + xffff88001e26be40) at mm/filemap.c:2600 + #5 0xffffffff810db853 in generic_file_aio_write (iocb=0xffff88001e26bde8, iov=0xffff88001e26bec8, nr_segs=, pos=) at mm/filemap.c:2632 + #6 0xffffffff811a71aa in ext4_file_write (iocb=0xffff88001e26bde8, iov=0xffff88001e26bec8, nr_segs=0x1, pos=0x108000) a\ + t fs/ext4/file.c:136 + #7 0xffffffff811375aa in do_sync_write (filp=0xffff88003f606a80, buf=, len=, \ + ppos=0xffff88001e26bf48) at fs/read_write.c:406 + #8 0xffffffff81137e56 in vfs_write (file=0xffff88003f606a80, buf=0x1ec2960
, count=0x4\ + 000, pos=0xffff88001e26bf48) at fs/read_write.c:435 + #9 0xffffffff8113816c in sys_write (fd=, buf=0x1ec2960
, count=0x\ + 4000) at fs/read_write.c:487 + #10 + #11 0x00007f120077a390 in __brk_reservation_fn_dmi_alloc__ () + #12 0x0000000000000000 in ?? () + gdb> print offset + $22 = 0xffffffffffffffff + gdb> print idx + $23 = 0xffffffff + gdb> print inode->i_blkbits + $24 = 0xc + gdb> up + #1 ext4_da_write_end (file=0xffff88003f606a80, mapping=0xffff88001d3824e0, pos=0x108000, len=0x1000, copied=0x0, page=0\ + xffffea0000d792e8, fsdata=0x0) at fs/ext4/inode.c:2512 + 2512 if (ext4_da_should_update_i_disksize(page, end)) { + gdb> print start + $25 = 0x0 + gdb> print end + $26 = 0xffffffffffffffff + gdb> print pos + $27 = 0x108000 + gdb> print new_i_size + $28 = 0x108000 + gdb> print ((struct ext4_inode_info *)((char *)inode-((int)(&((struct ext4_inode_info *)0)->vfs_inode))))->i_disksize + $29 = 0xd9000 + gdb> down + 2467 for (i = 0; i < idx; i++) + gdb> print i + $30 = 0xd44acbee + +This is 100% reproducible with some autonuma development code tuned in +a very aggressive manner (not normal way even for knumad) which does +"exotic" changes to the ptes. It wouldn't normally trigger but I don't +see why it can't happen normally if the page is added to swap cache in +between the two faults leading to "copied" being zero (which then +hangs in ext4). So it should be fixed. Especially possible with lumpy +reclaim (albeit disabled if compaction is enabled) as that would +ignore the young bits in the ptes. + +Signed-off-by: Andrea Arcangeli +Signed-off-by: "Theodore Ts'o" +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/inode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/ext4/inode.c ++++ b/fs/ext4/inode.c +@@ -2367,7 +2367,7 @@ static int ext4_da_write_end(struct file + */ + + new_i_size = pos + copied; +- if (new_i_size > EXT4_I(inode)->i_disksize) { ++ if (copied && new_i_size > EXT4_I(inode)->i_disksize) { + if (ext4_da_should_update_i_disksize(page, end)) { + down_write(&EXT4_I(inode)->i_data_sem); + if (new_i_size > EXT4_I(inode)->i_disksize) { diff --git a/queue-3.1/ext4-avoid-potential-hang-in-mpage_submit_io-when-blocksize-pagesize.patch b/queue-3.1/ext4-avoid-potential-hang-in-mpage_submit_io-when-blocksize-pagesize.patch new file mode 100644 index 00000000000..ec31ec45f81 --- /dev/null +++ b/queue-3.1/ext4-avoid-potential-hang-in-mpage_submit_io-when-blocksize-pagesize.patch @@ -0,0 +1,39 @@ +From 13a79a4741d37fda2fbafb953f0f301dc007928f Mon Sep 17 00:00:00 2001 +From: Yongqiang Yang +Date: Tue, 13 Dec 2011 21:51:55 -0500 +Subject: ext4: avoid potential hang in mpage_submit_io() when blocksize < pagesize + +From: Yongqiang Yang + +commit 13a79a4741d37fda2fbafb953f0f301dc007928f upstream. + +If there is an unwritten but clean buffer in a page and there is a +dirty buffer after the buffer, then mpage_submit_io does not write the +dirty buffer out. As a result, da_writepages loops forever. + +This patch fixes the problem by checking dirty flag. + +Signed-off-by: Yongqiang Yang +Signed-off-by: "Theodore Ts'o" +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/inode.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/fs/ext4/inode.c ++++ b/fs/ext4/inode.c +@@ -1261,8 +1261,11 @@ static int mpage_da_submit_io(struct mpa + clear_buffer_unwritten(bh); + } + +- /* skip page if block allocation undone */ +- if (buffer_delay(bh) || buffer_unwritten(bh)) ++ /* ++ * skip page if block allocation undone and ++ * block is dirty ++ */ ++ if (ext4_bh_delay_or_unwritten(NULL, bh)) + skip_page = 1; + bh = bh->b_this_page; + block_start += bh->b_size; diff --git a/queue-3.1/ext4-display-the-correct-mount-option-in-proc-mounts-for-init_itable.patch b/queue-3.1/ext4-display-the-correct-mount-option-in-proc-mounts-for-init_itable.patch new file mode 100644 index 00000000000..770d58e5dab --- /dev/null +++ b/queue-3.1/ext4-display-the-correct-mount-option-in-proc-mounts-for-init_itable.patch @@ -0,0 +1,75 @@ +From fc6cb1cda5db7b2d24bf32890826214b857c728e Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Mon, 12 Dec 2011 22:06:18 -0500 +Subject: ext4: display the correct mount option in /proc/mounts for [no]init_itable + +From: Theodore Ts'o + +commit fc6cb1cda5db7b2d24bf32890826214b857c728e upstream. + +/proc/mounts was showing the mount option [no]init_inode_table when +the correct mount option that will be accepted by parse_options() is +[no]init_itable. + +Signed-off-by: "Theodore Ts'o" +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/super.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -1140,9 +1140,9 @@ static int ext4_show_options(struct seq_ + seq_puts(seq, ",block_validity"); + + if (!test_opt(sb, INIT_INODE_TABLE)) +- seq_puts(seq, ",noinit_inode_table"); ++ seq_puts(seq, ",noinit_itable"); + else if (sbi->s_li_wait_mult != EXT4_DEF_LI_WAIT_MULT) +- seq_printf(seq, ",init_inode_table=%u", ++ seq_printf(seq, ",init_itable=%u", + (unsigned) sbi->s_li_wait_mult); + + ext4_show_quota_options(seq, sb); +@@ -1318,8 +1318,7 @@ enum { + Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity, + Opt_inode_readahead_blks, Opt_journal_ioprio, + Opt_dioread_nolock, Opt_dioread_lock, +- Opt_discard, Opt_nodiscard, +- Opt_init_inode_table, Opt_noinit_inode_table, ++ Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable, + }; + + static const match_table_t tokens = { +@@ -1392,9 +1391,9 @@ static const match_table_t tokens = { + {Opt_dioread_lock, "dioread_lock"}, + {Opt_discard, "discard"}, + {Opt_nodiscard, "nodiscard"}, +- {Opt_init_inode_table, "init_itable=%u"}, +- {Opt_init_inode_table, "init_itable"}, +- {Opt_noinit_inode_table, "noinit_itable"}, ++ {Opt_init_itable, "init_itable=%u"}, ++ {Opt_init_itable, "init_itable"}, ++ {Opt_noinit_itable, "noinit_itable"}, + {Opt_err, NULL}, + }; + +@@ -1871,7 +1870,7 @@ set_qf_format: + case Opt_dioread_lock: + clear_opt(sb, DIOREAD_NOLOCK); + break; +- case Opt_init_inode_table: ++ case Opt_init_itable: + set_opt(sb, INIT_INODE_TABLE); + if (args[0].from) { + if (match_int(&args[0], &option)) +@@ -1882,7 +1881,7 @@ set_qf_format: + return 0; + sbi->s_li_wait_mult = option; + break; +- case Opt_noinit_inode_table: ++ case Opt_noinit_itable: + clear_opt(sb, INIT_INODE_TABLE); + break; + default: diff --git a/queue-3.1/ext4-fix-ext4_end_io_dio-racing-against-fsync.patch b/queue-3.1/ext4-fix-ext4_end_io_dio-racing-against-fsync.patch new file mode 100644 index 00000000000..f59eefc75cb --- /dev/null +++ b/queue-3.1/ext4-fix-ext4_end_io_dio-racing-against-fsync.patch @@ -0,0 +1,45 @@ +From b5a7e97039a80fae673ccc115ce595d5b88fb4ee Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Mon, 12 Dec 2011 10:53:02 -0500 +Subject: ext4: fix ext4_end_io_dio() racing against fsync() + +From: Theodore Ts'o + +commit b5a7e97039a80fae673ccc115ce595d5b88fb4ee upstream. + +We need to make sure iocb->private is cleared *before* we put the +io_end structure on i_completed_io_list. Otherwise fsync() could +potentially run on another CPU and free the iocb structure out from +under us. + +Reported-by: Kent Overstreet +Signed-off-by: "Theodore Ts'o" +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/inode.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/fs/ext4/inode.c ++++ b/fs/ext4/inode.c +@@ -2630,10 +2630,11 @@ static void ext4_end_io_dio(struct kiocb + iocb->private, io_end->inode->i_ino, iocb, offset, + size); + ++ iocb->private = NULL; ++ + /* if not aio dio with unwritten extents, just free io and return */ + if (!(io_end->flag & EXT4_IO_END_UNWRITTEN)) { + ext4_free_io_end(io_end); +- iocb->private = NULL; + out: + if (is_async) + aio_complete(iocb, ret, 0); +@@ -2656,7 +2657,6 @@ out: + spin_unlock_irqrestore(&ei->i_completed_io_lock, flags); + + /* queue the work to convert unwritten extents to written */ +- iocb->private = NULL; + queue_work(wq, &io_end->work); + + /* XXX: probably should move into the real I/O completion handler */ diff --git a/queue-3.1/ext4-handle-eof-correctly-in-ext4_bio_write_page.patch b/queue-3.1/ext4-handle-eof-correctly-in-ext4_bio_write_page.patch new file mode 100644 index 00000000000..95e32c41c9f --- /dev/null +++ b/queue-3.1/ext4-handle-eof-correctly-in-ext4_bio_write_page.patch @@ -0,0 +1,41 @@ +From 5a0dc7365c240795bf190766eba7a27600be3b3e Mon Sep 17 00:00:00 2001 +From: Yongqiang Yang +Date: Tue, 13 Dec 2011 22:29:12 -0500 +Subject: ext4: handle EOF correctly in ext4_bio_write_page() + +From: Yongqiang Yang + +commit 5a0dc7365c240795bf190766eba7a27600be3b3e upstream. + +We need to zero out part of a page which beyond EOF before setting uptodate, +otherwise, mapread or write will see non-zero data beyond EOF. + +Signed-off-by: Yongqiang Yang +Signed-off-by: "Theodore Ts'o" +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/page-io.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/fs/ext4/page-io.c ++++ b/fs/ext4/page-io.c +@@ -401,6 +401,18 @@ int ext4_bio_write_page(struct ext4_io_s + + block_end = block_start + blocksize; + if (block_start >= len) { ++ /* ++ * Comments copied from block_write_full_page_endio: ++ * ++ * The page straddles i_size. It must be zeroed out on ++ * each and every writepage invocation because it may ++ * be mmapped. "A file is mapped in multiples of the ++ * page size. For a file that is not a multiple of ++ * the page size, the remaining memory is zeroed when ++ * mapped, and writes to that region are not written ++ * out to the file." ++ */ ++ zero_user_segment(page, block_start, block_end); + clear_buffer_dirty(bh); + set_buffer_uptodate(bh); + continue; diff --git a/queue-3.1/fuse-fix-fuse_retrieve.patch b/queue-3.1/fuse-fix-fuse_retrieve.patch new file mode 100644 index 00000000000..26fb802bd92 --- /dev/null +++ b/queue-3.1/fuse-fix-fuse_retrieve.patch @@ -0,0 +1,46 @@ +From 48706d0a91583d08c56e7ef2a7602d99c8d4133f Mon Sep 17 00:00:00 2001 +From: Miklos Szeredi +Date: Tue, 13 Dec 2011 10:36:59 +0100 +Subject: fuse: fix fuse_retrieve + +From: Miklos Szeredi + +commit 48706d0a91583d08c56e7ef2a7602d99c8d4133f upstream. + +Fix two bugs in fuse_retrieve(): + + - retrieving more than one page would yield repeated instances of the + first page + + - if more than FUSE_MAX_PAGES_PER_REQ pages were requested than the + request page array would overflow + +fuse_retrieve() was added in 2.6.36 and these bugs had been there since the +beginning. + +Signed-off-by: Miklos Szeredi +Signed-off-by: Greg Kroah-Hartman + +--- + fs/fuse/dev.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/fuse/dev.c ++++ b/fs/fuse/dev.c +@@ -1512,7 +1512,7 @@ static int fuse_retrieve(struct fuse_con + else if (outarg->offset + num > file_size) + num = file_size - outarg->offset; + +- while (num) { ++ while (num && req->num_pages < FUSE_MAX_PAGES_PER_REQ) { + struct page *page; + unsigned int this_num; + +@@ -1526,6 +1526,7 @@ static int fuse_retrieve(struct fuse_con + + num -= this_num; + total_len += this_num; ++ index++; + } + req->misc.retrieve_in.offset = outarg->offset; + req->misc.retrieve_in.size = total_len; diff --git a/queue-3.1/fuse-fix-llseek-bug.patch b/queue-3.1/fuse-fix-llseek-bug.patch new file mode 100644 index 00000000000..a01c4d8590e --- /dev/null +++ b/queue-3.1/fuse-fix-llseek-bug.patch @@ -0,0 +1,39 @@ +From b48c6af2086ab2ba8a9c9b6ce9ecb34592ce500c Mon Sep 17 00:00:00 2001 +From: Roel Kluin +Date: Tue, 13 Dec 2011 10:37:00 +0100 +Subject: fuse: fix llseek bug + +From: Roel Kluin + +commit b48c6af2086ab2ba8a9c9b6ce9ecb34592ce500c upstream. + +The test in fuse_file_llseek() "not SEEK_CUR or not SEEK_SET" always evaluates +to true. + +This was introduced in 3.1 by commit 06222e49 (fs: handle SEEK_HOLE/SEEK_DATA +properly in all fs's that define their own llseek) and changed the behavior of +SEEK_CUR and SEEK_SET to always retrieve the file attributes. This is a +performance regression. + +Fix the test so that it makes sense. + +Signed-off-by: Miklos Szeredi +CC: Josef Bacik +CC: Al Viro +Signed-off-by: Greg Kroah-Hartman + +--- + fs/fuse/file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/fuse/file.c ++++ b/fs/fuse/file.c +@@ -1556,7 +1556,7 @@ static loff_t fuse_file_llseek(struct fi + struct inode *inode = file->f_path.dentry->d_inode; + + mutex_lock(&inode->i_mutex); +- if (origin != SEEK_CUR || origin != SEEK_SET) { ++ if (origin != SEEK_CUR && origin != SEEK_SET) { + retval = fuse_update_attributes(inode, NULL, file, NULL); + if (retval) + goto exit; diff --git a/queue-3.1/series b/queue-3.1/series index 976c9dc74e1..6d34c27cb57 100644 --- a/queue-3.1/series +++ b/queue-3.1/series @@ -37,3 +37,13 @@ hfs-fix-hfs_find_init-sb-ext_tree-null-ptr-oops.patch drm-radeon-kms-cleanup-atombios_adjust_pll.patch drm-radeon-kms-rework-dp-bridge-checks.patch drm-radeon-kms-fix-dp-setup-on-travis-bridges.patch +xen-only-limit-memory-map-to-maximum-reservation-for-domain-0.patch +ext4-fix-ext4_end_io_dio-racing-against-fsync.patch +ext4-display-the-correct-mount-option-in-proc-mounts-for-init_itable.patch +ext4-avoid-hangs-in-ext4_da_should_update_i_disksize.patch +ext4-avoid-potential-hang-in-mpage_submit_io-when-blocksize-pagesize.patch +ext4-handle-eof-correctly-in-ext4_bio_write_page.patch +fuse-fix-fuse_retrieve.patch +fuse-fix-llseek-bug.patch +staging-r8712u-add-new-usb-id.patch +drm-radeon-kms-add-some-new-pci-ids.patch diff --git a/queue-3.1/staging-r8712u-add-new-usb-id.patch b/queue-3.1/staging-r8712u-add-new-usb-id.patch new file mode 100644 index 00000000000..d9abcd6b06e --- /dev/null +++ b/queue-3.1/staging-r8712u-add-new-usb-id.patch @@ -0,0 +1,29 @@ +From c7caf4d4c56aee40b995f5858ccf1c814f3d2da2 Mon Sep 17 00:00:00 2001 +From: Larry Finger +Date: Sun, 11 Dec 2011 10:27:54 -0600 +Subject: staging: r8712u: Add new USB ID + +From: Larry Finger + +commit c7caf4d4c56aee40b995f5858ccf1c814f3d2da2 upstream. + +Add USB ID for Sitecom WLA-2000 v1.001 WLAN. + +Reported-and-tested-by: Roland Gruber +Signed-off-by: Larry Finger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/rtl8712/usb_intf.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/staging/rtl8712/usb_intf.c ++++ b/drivers/staging/rtl8712/usb_intf.c +@@ -86,6 +86,7 @@ static struct usb_device_id rtl871x_usb_ + {USB_DEVICE(0x0DF6, 0x0045)}, + {USB_DEVICE(0x0DF6, 0x0059)}, /* 11n mode disable */ + {USB_DEVICE(0x0DF6, 0x004B)}, ++ {USB_DEVICE(0x0DF6, 0x005D)}, + {USB_DEVICE(0x0DF6, 0x0063)}, + /* Sweex */ + {USB_DEVICE(0x177F, 0x0154)}, diff --git a/queue-3.1/xen-only-limit-memory-map-to-maximum-reservation-for-domain-0.patch b/queue-3.1/xen-only-limit-memory-map-to-maximum-reservation-for-domain-0.patch new file mode 100644 index 00000000000..7b84f8163c3 --- /dev/null +++ b/queue-3.1/xen-only-limit-memory-map-to-maximum-reservation-for-domain-0.patch @@ -0,0 +1,92 @@ +From d3db728125c4470a2d061ac10fa7395e18237263 Mon Sep 17 00:00:00 2001 +From: Ian Campbell +Date: Wed, 14 Dec 2011 12:16:08 +0000 +Subject: xen: only limit memory map to maximum reservation for domain 0. + +From: Ian Campbell + +commit d3db728125c4470a2d061ac10fa7395e18237263 upstream. + +d312ae878b6a "xen: use maximum reservation to limit amount of usable RAM" +clamped the total amount of RAM to the current maximum reservation. This is +correct for dom0 but is not correct for guest domains. In order to boot a guest +"pre-ballooned" (e.g. with memory=1G but maxmem=2G) in order to allow for +future memory expansion the guest must derive max_pfn from the e820 provided by +the toolstack and not the current maximum reservation (which can reflect only +the current maximum, not the guest lifetime max). The existing algorithm +already behaves this correctly if we do not artificially limit the maximum +number of pages for the guest case. + +For a guest booted with maxmem=512, memory=128 this results in: + [ 0.000000] BIOS-provided physical RAM map: + [ 0.000000] Xen: 0000000000000000 - 00000000000a0000 (usable) + [ 0.000000] Xen: 00000000000a0000 - 0000000000100000 (reserved) +-[ 0.000000] Xen: 0000000000100000 - 0000000008100000 (usable) +-[ 0.000000] Xen: 0000000008100000 - 0000000020800000 (unusable) ++[ 0.000000] Xen: 0000000000100000 - 0000000020800000 (usable) +... + [ 0.000000] NX (Execute Disable) protection: active + [ 0.000000] DMI not present or invalid. + [ 0.000000] e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved) + [ 0.000000] e820 remove range: 00000000000a0000 - 0000000000100000 (usable) +-[ 0.000000] last_pfn = 0x8100 max_arch_pfn = 0x1000000 ++[ 0.000000] last_pfn = 0x20800 max_arch_pfn = 0x1000000 + [ 0.000000] initial memory mapped : 0 - 027ff000 + [ 0.000000] Base memory trampoline at [c009f000] 9f000 size 4096 +-[ 0.000000] init_memory_mapping: 0000000000000000-0000000008100000 +-[ 0.000000] 0000000000 - 0008100000 page 4k +-[ 0.000000] kernel direct mapping tables up to 8100000 @ 27bb000-27ff000 ++[ 0.000000] init_memory_mapping: 0000000000000000-0000000020800000 ++[ 0.000000] 0000000000 - 0020800000 page 4k ++[ 0.000000] kernel direct mapping tables up to 20800000 @ 26f8000-27ff000 + [ 0.000000] xen: setting RW the range 27e8000 - 27ff000 + [ 0.000000] 0MB HIGHMEM available. +-[ 0.000000] 129MB LOWMEM available. +-[ 0.000000] mapped low ram: 0 - 08100000 +-[ 0.000000] low ram: 0 - 08100000 ++[ 0.000000] 520MB LOWMEM available. ++[ 0.000000] mapped low ram: 0 - 20800000 ++[ 0.000000] low ram: 0 - 20800000 + +With this change "xl mem-set 512M" will successfully increase the +guest RAM (by reducing the balloon). + +There is no change for dom0. + +Reported-and-Tested-by: George Shuklin +Signed-off-by: Ian Campbell +Reviewed-by: David Vrabel +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/xen/setup.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +--- a/arch/x86/xen/setup.c ++++ b/arch/x86/xen/setup.c +@@ -191,9 +191,21 @@ static unsigned long __init xen_get_max_ + domid_t domid = DOMID_SELF; + int ret; + +- ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid); +- if (ret > 0) +- max_pages = ret; ++ /* ++ * For the initial domain we use the maximum reservation as ++ * the maximum page. ++ * ++ * For guest domains the current maximum reservation reflects ++ * the current maximum rather than the static maximum. In this ++ * case the e820 map provided to us will cover the static ++ * maximum region. ++ */ ++ if (xen_initial_domain()) { ++ ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid); ++ if (ret > 0) ++ max_pages = ret; ++ } ++ + return min(max_pages, MAX_DOMAIN_PAGES); + } +