1. 15 Dec, 2011 7 commits
    • Linus Torvalds's avatar
      Merge branch 'stable/for-linus-fixes-3.2' of... · 42ebfc61
      Linus Torvalds authored
      Merge branch 'stable/for-linus-fixes-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
      
      * 'stable/for-linus-fixes-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
        xen/swiotlb: Use page alignment for early buffer allocation.
        xen: only limit memory map to maximum reservation for domain 0.
      42ebfc61
    • Konrad Rzeszutek Wilk's avatar
      xen/swiotlb: Use page alignment for early buffer allocation. · 63a74175
      Konrad Rzeszutek Wilk authored
      This fixes an odd bug found on a Dell PowerEdge 1850/0RC130
      (BIOS A05 01/09/2006) where all of the modules doing pci_set_dma_mask
      would fail with:
      
      ata_piix 0000:00:1f.1: enabling device (0005 -> 0007)
      ata_piix 0000:00:1f.1: can't derive routing for PCI INT A
      ata_piix 0000:00:1f.1: BMDMA: failed to set dma mask, falling back to PIO
      
      The issue was the Xen-SWIOTLB was allocated such as that the end of
      buffer was stradling a page (and also above 4GB). The fix was
      spotted by Kalev Leonid  which was to piggyback on git commit
      e79f86b2 "swiotlb: Use page alignment
      for early buffer allocation" which:
      
      	We could call free_bootmem_late() if swiotlb is not used, and
      	it will shrink to page alignment.
      
      	So alloc them with page alignment at first, to avoid lose two pages
      
      And doing that fixes the outstanding issue.
      
      CC: stable@kernel.org
      Suggested-by: default avatar"Kalev, Leonid" <Leonid.Kalev@ca.com>
      Reported-and-Tested-by: default avatar"Taylor, Neal E" <Neal.Taylor@ca.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      63a74175
    • Ian Campbell's avatar
      xen: only limit memory map to maximum reservation for domain 0. · d3db7281
      Ian Campbell authored
      d312ae87 "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 <domain> 512M" will successfully increase the
      guest RAM (by reducing the balloon).
      
      There is no change for dom0.
      Reported-and-Tested-by: default avatarGeorge Shuklin <george.shuklin@gmail.com>
      Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Cc: stable@kernel.org
      Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      d3db7281
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 55b02d2f
      Linus Torvalds authored
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/radeon/kms: add some new pci ids
      55b02d2f
    • Linus Torvalds's avatar
      Merge tag 'tytso-for-linus-20111214' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 2240a7bb
      Linus Torvalds authored
      * tag 'tytso-for-linus-20111214' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: handle EOF correctly in ext4_bio_write_page()
        ext4: remove a wrong BUG_ON in ext4_ext_convert_to_initialized
        ext4: correctly handle pages w/o buffers in ext4_discard_partial_buffers()
        ext4: avoid potential hang in mpage_submit_io() when blocksize < pagesize
        ext4: avoid hangs in ext4_da_should_update_i_disksize()
        ext4: display the correct mount option in /proc/mounts for [no]init_itable
        ext4: Fix crash due to getting bogus eh_depth value on big-endian systems
        ext4: fix ext4_end_io_dio() racing against fsync()
      
      .. using the new signed tag merge of git that now verifies the gpg
      signature automatically.  Yay.  The branchname was just 'dev', which is
      prettier.  I'll tell Ted to use nicer tag names for future cases.
      2240a7bb
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse · 30aaca45
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
        fuse: llseek fix race
        fuse: fix llseek bug
        fuse: fix fuse_retrieve
      30aaca45
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · ddb36077
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fs/ncpfs: fix error paths and goto statements in ncp_fill_super()
        configfs: register_filesystem() called too early
        fuse: register_filesystem() called too early
        ubifs: too early register_filesystem()
        ... and the same kind of leak for mqueue
        procfs: fix a vfsmount longterm reference leak
      ddb36077
  2. 14 Dec, 2011 7 commits
    • Alex Deucher's avatar
      cd5cfce8
    • Djalal Harouni's avatar
      fs/ncpfs: fix error paths and goto statements in ncp_fill_super() · 759c361e
      Djalal Harouni authored
      The label 'out_bdi' should be followed by bdi_destroy() instead of
      fput() which should be after the 'out_fput' label.
      
      If bdi_setup_and_register() fails then jump to the 'out_fput' label
      instead of the 'out_bdi' one.
      
      If fget(data.info_fd) fails then jump to the previously fixed 'out_bdi'
      label to call bdi_destroy() otherwise the bdi object will not be
      destroyed.
      
      Compile tested only.
      Signed-off-by: default avatarDjalal Harouni <tixxdz@opendz.org>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      759c361e
    • Yongqiang Yang's avatar
      ext4: handle EOF correctly in ext4_bio_write_page() · 5a0dc736
      Yongqiang Yang authored
      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: default avatarYongqiang Yang <xiaoqiangnk@gmail.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@kernel.org
      5a0dc736
    • Yongqiang Yang's avatar
      ext4: remove a wrong BUG_ON in ext4_ext_convert_to_initialized · 5b5ffa49
      Yongqiang Yang authored
      If a file is fallocated on a hole, map->m_lblk + map->m_len may be greater
      than ee_block + ee_len.
      Signed-off-by: default avatarYongqiang Yang <xiaoqiangnk@gmail.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@kernel.org
      5b5ffa49
    • Yongqiang Yang's avatar
      ext4: correctly handle pages w/o buffers in ext4_discard_partial_buffers() · 093e6e36
      Yongqiang Yang authored
      If a page has been read into memory and never been written, it has no
      buffers, but we should handle the page in truncate or punch hole.
      
      VFS code of writing operations has handled holes correctly, so this
      patch removes the code handling holes in writing operations.
      Signed-off-by: default avatarYongqiang Yang <xiaoqiangnk@gmail.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@kernel.org
      093e6e36
    • Yongqiang Yang's avatar
      ext4: avoid potential hang in mpage_submit_io() when blocksize < pagesize · 13a79a47
      Yongqiang Yang authored
      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: default avatarYongqiang Yang <xiaoqiangnk@gmail.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@kernel.org
      13a79a47
    • Andrea Arcangeli's avatar
      ext4: avoid hangs in ext4_da_should_update_i_disksize() · ea51d132
      Andrea Arcangeli authored
      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=<value optimized out>, iov=<value optimized out>, nr_segs=<value o\
       ptimized out>, pos=0x108000, ppos=0xffff88001e26be40, count=<value optimized out>, written=0x0) at mm/filemap.c:2440
       #3  generic_file_buffered_write (iocb=<value optimized out>, iov=<value optimized out>, nr_segs=<value optimized out>, p\
       os=0x108000, ppos=0xffff88001e26be40, count=<value optimized out>, 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=<value optimi\
       zed out>, pos=<value optimized out>) 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=<value optimized out>, len=<value optimized out>, \
       ppos=0xffff88001e26bf48) at fs/read_write.c:406
       #8  0xffffffff81137e56 in vfs_write (file=0xffff88003f606a80, buf=0x1ec2960 <Address 0x1ec2960 out of bounds>, count=0x4\
       000, pos=0xffff88001e26bf48) at fs/read_write.c:435
       #9  0xffffffff8113816c in sys_write (fd=<value optimized out>, buf=0x1ec2960 <Address 0x1ec2960 out of bounds>, count=0x\
       4000) at fs/read_write.c:487
       #10 <signal handler called>
       #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: default avatarAndrea Arcangeli <aarcange@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@kernel.org
      ea51d132
  3. 13 Dec, 2011 16 commits
  4. 12 Dec, 2011 6 commits
  5. 11 Dec, 2011 1 commit
  6. 10 Dec, 2011 3 commits