Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Jul 13, 2012
  1. @torvalds

    Merge tag 'nfs-for-3.5-4' of git://git.linux-nfs.org/projects/trondmy…

    torvalds authored
    …/linux-nfs
    
    Pull NFS client bugfixes from Trond Myklebust:
     - Fix an NFSv4 mount regression
     - Fix O_DIRECT list manipulation snafus
    
    * tag 'nfs-for-3.5-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
      NFSv4: Fix an NFSv4 mount regression
      NFS: Fix list manipulation snafus in fs/nfs/direct.c
  2. @kernelslacker @torvalds

    Remove easily user-triggerable BUG from generic_setlease

    kernelslacker authored torvalds committed
    This can be trivially triggered from userspace by passing in something unexpected.
    
        kernel BUG at fs/locks.c:1468!
        invalid opcode: 0000 [#1] SMP
        RIP: 0010:generic_setlease+0xc2/0x100
        Call Trace:
          __vfs_setlease+0x35/0x40
          fcntl_setlease+0x76/0x150
          sys_fcntl+0x1c6/0x810
          system_call_fastpath+0x1a/0x1f
    
    Signed-off-by: Dave Jones <davej@redhat.com>
    Cc: stable@kernel.org # 3.2+
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  3. @JeffMoyer @torvalds

    block: fix infinite loop in __getblk_slow

    JeffMoyer authored torvalds committed
    Commit 080399a ("block: don't mark buffers beyond end of disk as
    mapped") exposed a bug in __getblk_slow that causes mount to hang as it
    loops infinitely waiting for a buffer that lies beyond the end of the
    disk to become uptodate.
    
    The problem was initially reported by Torsten Hilbrich here:
    
        https://lkml.org/lkml/2012/6/18/54
    
    and also reported independently here:
    
        http://www.sysresccd.org/forums/viewtopic.php?f=13&t=4511
    
    and then Richard W.M.  Jones and Marcos Mello noted a few separate
    bugzillas also associated with the same issue.  This patch has been
    confirmed to fix:
    
        https://bugzilla.redhat.com/show_bug.cgi?id=835019
    
    The main problem is here, in __getblk_slow:
    
            for (;;) {
                    struct buffer_head * bh;
                    int ret;
    
                    bh = __find_get_block(bdev, block, size);
                    if (bh)
                            return bh;
    
                    ret = grow_buffers(bdev, block, size);
                    if (ret < 0)
                            return NULL;
                    if (ret == 0)
                            free_more_memory();
            }
    
    __find_get_block does not find the block, since it will not be marked as
    mapped, and so grow_buffers is called to fill in the buffers for the
    associated page.  I believe the for (;;) loop is there primarily to
    retry in the case of memory pressure keeping grow_buffers from
    succeeding.  However, we also continue to loop for other cases, like the
    block lying beond the end of the disk.  So, the fix I came up with is to
    only loop when grow_buffers fails due to memory allocation issues
    (return value of 0).
    
    The attached patch was tested by myself, Torsten, and Rich, and was
    found to resolve the problem in call cases.
    
    Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
    Reported-and-Tested-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
    Tested-by: Richard W.M. Jones <rjones@redhat.com>
    Reviewed-by: Josh Boyer <jwboyer@redhat.com>
    Cc: Stable <stable@vger.kernel.org>  # 3.0+
    [ Jens is on vacation, taking this directly  - Linus ]
    --
    Stable Notes: this patch requires backport to 3.0, 3.2 and 3.3.
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Commits on Jul 11, 2012
  1. @smagnani @torvalds

    fat: fix non-atomic NFS i_pos read

    smagnani authored torvalds committed
    fat_encode_fh() can fetch an invalid i_pos value on systems where 64-bit
    accesses are not atomic.  Make it use the same accessor as the rest of the
    FAT code.
    
    Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
    Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  2. @lliubbo @torvalds

    fs: ramfs: file-nommu: add SetPageUptodate()

    lliubbo authored torvalds committed
    There is a bug in the below scenario for !CONFIG_MMU:
    
     1. create a new file
     2. mmap the file and write to it
     3. read the file can't get the correct value
    
    Because
    
      sys_read() -> generic_file_aio_read() -> simple_readpage() -> clear_page()
    
    which causes the page to be zeroed.
    
    Add SetPageUptodate() to ramfs_nommu_expand_for_mapping() so that
    generic_file_aio_read() do not call simple_readpage().
    
    Signed-off-by: Bob Liu <lliubbo@gmail.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: David Howells <dhowells@redhat.com>
    Cc: Geert Uytterhoeven <geert@linux-m68k.org>
    Cc: Greg Ungerer <gerg@uclinux.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  3. @torvalds

    ocfs2: fix NULL pointer dereference in __ocfs2_change_file_space()

    Luis Henriques authored torvalds committed
    As ocfs2_fallocate() will invoke __ocfs2_change_file_space() with a NULL
    as the first parameter (file), it may trigger a NULL pointer dereferrence
    due to a missing check.
    
    Addresses http://bugs.launchpad.net/bugs/1006012
    
    Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
    Reported-by: Bret Towe <magnade@gmail.com>
    Tested-by: Bret Towe <magnade@gmail.com>
    Cc: Sunil Mushran <sunil.mushran@oracle.com>
    Acked-by: Joel Becker <jlbec@evilplan.org>
    Acked-by: Mark Fasheh <mfasheh@suse.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Commits on Jul 10, 2012
  1. NFSv4: Fix an NFSv4 mount regression

    Trond Myklebust authored
    The helper nfs_fs_mount() will always call nfs4_try_mount with the
    mount_info->fill_super argument pointing to nfs_fill_super, which is
    NFSv2/v3 only.
    Fix is to have nfs4_try_mount replace it with nfs4_fill_super.
    
    The regression was introduced by commit c40f8d1 (NFS: Create a common
    fs_mount() function)
    
    Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Commits on Jul 8, 2012
  1. NFS: Fix list manipulation snafus in fs/nfs/direct.c

    Trond Myklebust authored
    Fix 2 bugs in nfs_direct_write_reschedule:
    
     - The request needs to be removed from the 'reqs' list before it can
       be added to 'failed'.
     - Fix an infinite loop if the 'failed' list is non-empty.
    
    Reported-by: Julia Lawall <julia.lawall@lip6.fr>
    Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  2. @torvalds

    vfs: make O_PATH file descriptors usable for 'fchdir()'

    torvalds authored
    We already use them for openat() and friends, but fchdir() also wants to
    be able to use O_PATH file descriptors.  This should make it comparable
    to the O_SEARCH of Solaris.  In particular, O_PATH allows you to access
    (not-quite-open) a directory you don't have read persmission to, only
    execute permission.
    
    Noticed during development of multithread support for ksh93.
    
    Reported-by: ольга крыжановская <olga.kryzhanovska@gmail.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: stable@kernel.org    # O_PATH introduced in 3.0+
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Commits on Jul 6, 2012
  1. @torvalds

    Merge tag 'ecryptfs-3.5-rc6-fixes' of git://git.kernel.org/pub/scm/li…

    torvalds authored
    …nux/kernel/git/tyhicks/ecryptfs
    
    Pull eCryptfs fixes from Tyler Hicks:
     "Fixes an incorrect access mode check when preparing to open a file in
      the lower filesystem.  This isn't an urgent fix, but it is simple and
      the check was obviously incorrect.
    
      Also fixes a couple important bugs in the eCryptfs miscdev interface.
      These changes are low risk due to the small number of users that use
      the miscdev interface.  I was able to keep the changes minimal and I
      have some cleaner, more complete changes queued up for the next merge
      window that will build on these patches."
    
    * tag 'ecryptfs-3.5-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
      eCryptfs: Gracefully refuse miscdev file ops on inherited/passed files
      eCryptfs: Fix lockdep warning in miscdev operations
      eCryptfs: Properly check for O_RDONLY flag before doing privileged open
  2. eCryptfs: Gracefully refuse miscdev file ops on inherited/passed files

    Tyler Hicks authored
    File operations on /dev/ecryptfs would BUG() when the operations were
    performed by processes other than the process that originally opened the
    file. This could happen with open files inherited after fork() or file
    descriptors passed through IPC mechanisms. Rather than calling BUG(), an
    error code can be safely returned in most situations.
    
    In ecryptfs_miscdev_release(), eCryptfs still needs to handle the
    release even if the last file reference is being held by a process that
    didn't originally open the file. ecryptfs_find_daemon_by_euid() will not
    be successful, so a pointer to the daemon is stored in the file's
    private_data. The private_data pointer is initialized when the miscdev
    file is opened and only used when the file is released.
    
    https://launchpad.net/bugs/994247
    
    Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
    Reported-by: Sasha Levin <levinsasha928@gmail.com>
    Tested-by: Sasha Levin <levinsasha928@gmail.com>
  3. @torvalds

    Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git…

    torvalds authored
    …/jlbec/ocfs2
    
    Pull ocfs2 fixes from Joel Becker.
    
    * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
      aio: make kiocb->private NUll in init_sync_kiocb()
      ocfs2: Fix bogus error message from ocfs2_global_read_info
      ocfs2: for SEEK_DATA/SEEK_HOLE, return internal error unchanged if ocfs2_get_clusters_nocache() or ocfs2_inode_lock() call failed.
      ocfs2: use spinlock irqsave for downconvert lock.patch
      ocfs2: Misplaced parens in unlikley
      ocfs2: clear unaligned io flag when dio fails
  4. @torvalds

    Merge git://git.samba.org/sfrench/cifs-2.6

    torvalds authored
    Pull cifs fixes from Steve French.
    
    * git://git.samba.org/sfrench/cifs-2.6:
      cifs: when server doesn't set CAP_LARGE_READ_X, cap default rsize at MaxBufferSize
      cifs: fix parsing of password mount option
Commits on Jul 5, 2012
  1. @torvalds

    Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…

    torvalds authored
    …/git/mason/linux-btrfs
    
    Pull btrfs updates from Chris Mason:
     "I held off on my rc5 pull because I hit an oops during log recovery
      after a crash.  I wanted to make sure it wasn't a regression because
      we have some logging fixes in here.
    
      It turns out that a commit during the merge window just made it much
      more likely to trigger directory logging instead of full commits,
      which exposed an old bug.
    
      The new backref walking code got some additional fixes.  This should
      be the final set of them.
    
      Josef fixed up a corner where our O_DIRECT writes and buffered reads
      could expose old file contents (not stale, just not the most recent).
      He and Liu Bo fixed crashes during tree log recover as well.
    
      Ilya fixed errors while we resume disk balancing operations on
      readonly mounts."
    
    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
      Btrfs: run delayed directory updates during log replay
      Btrfs: hold a ref on the inode during writepages
      Btrfs: fix tree log remove space corner case
      Btrfs: fix wrong check during log recovery
      Btrfs: use _IOR for BTRFS_IOC_SUBVOL_GETFLAGS
      Btrfs: resume balance on rw (re)mounts properly
      Btrfs: restore restriper state on all mounts
      Btrfs: fix dio write vs buffered read race
      Btrfs: don't count I/O statistic read errors for missing devices
      Btrfs: resolve tree mod log locking issue in btrfs_next_leaf
      Btrfs: fix tree mod log rewind of ADD operations
      Btrfs: leave critical region in btrfs_find_all_roots as soon as possible
      Btrfs: always put insert_ptr modifications into the tree mod log
      Btrfs: fix tree mod log for root replacements at leaf level
      Btrfs: support root level changes in __resolve_indirect_ref
      Btrfs: avoid waiting for delayed refs when we must not
Commits on Jul 4, 2012
  1. @jankara

    ocfs2: Fix bogus error message from ocfs2_global_read_info

    jankara authored Joel Becker committed
    'status' variable in ocfs2_global_read_info() is always != 0 when leaving the
    function because it happens to contain number of read bytes. Thus we always log
    error message although everything is OK. Since all error cases properly call
    mlog_errno() before jumping to out_err, there's no reason to call mlog_errno()
    on exit at all. This is a fallout of c1e8d35 (conversion of mlog_exit()
    calls).
    
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Joel Becker <jlbec@evilplan.org>
  2. @pibroch

    ocfs2: for SEEK_DATA/SEEK_HOLE, return internal error unchanged if oc…

    pibroch authored Joel Becker committed
    …fs2_get_clusters_nocache() or ocfs2_inode_lock() call failed.
    
    Hello,
    
    Since ENXIO only means "offset beyond EOF" for SEEK_DATA/SEEK_HOLE,
    Hence we should return the internal error unchanged if ocfs2_inode_lock() or
    ocfs2_get_clusters_nocache() call failed rather than ENXIO.
    Otherwise, it will confuse the user applications when they trying to understand the root cause.
    
    Thanks Dave for pointing this out.
    
    Thanks,
    -Jeff
    
    Cc: Dave Chinner <david@fromorbit.com>
    Signed-off-by: Jie Liu <jeff.liu@oracle.com>
    Signed-off-by: Joel Becker <jlbec@evilplan.org>
  3. @seeda

    ocfs2: use spinlock irqsave for downconvert lock.patch

    seeda authored Joel Becker committed
    When ocfs2dc thread holds dc_task_lock spinlock and receives soft IRQ it
    deadlock itself trying to get same spinlock in ocfs2_wake_downconvert_thread.
    Below is the stack snippet.
    
    The patch disables interrupts when acquiring dc_task_lock spinlock.
    
    	ocfs2_wake_downconvert_thread
    	ocfs2_rw_unlock
    	ocfs2_dio_end_io
    	dio_complete
    	.....
    	bio_endio
    	req_bio_endio
    	....
    	scsi_io_completion
    	blk_done_softirq
    	__do_softirq
    	do_softirq
    	irq_exit
    	do_IRQ
    	ocfs2_downconvert_thread
    	[kthread]
    
    Signed-off-by: Srinivas Eeda <srinivas.eeda@oracle.com>
    Signed-off-by: Joel Becker <jlbec@evilplan.org>
  4. @RoelKluin

    ocfs2: Misplaced parens in unlikley

    RoelKluin authored Joel Becker committed
    Fix misplaced parentheses
    
    Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
    Signed-off-by: Joel Becker <jlbec@evilplan.org>
  5. ocfs2: clear unaligned io flag when dio fails

    Junxiao Bi authored Joel Becker committed
    The unaligned io flag is set in the kiocb when an unaligned
    dio is issued, it should be cleared even when the dio fails,
    or it may affect the following io which are using the same
    kiocb.
    
    Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Joel Becker <jlbec@evilplan.org>
Commits on Jul 3, 2012
  1. eCryptfs: Fix lockdep warning in miscdev operations

    Tyler Hicks authored
    Don't grab the daemon mutex while holding the message context mutex.
    Addresses this lockdep warning:
    
     ecryptfsd/2141 is trying to acquire lock:
      (&ecryptfs_msg_ctx_arr[i].mux){+.+.+.}, at: [<ffffffffa029c213>] ecryptfs_miscdev_read+0x143/0x470 [ecryptfs]
    
     but task is already holding lock:
      (&(*daemon)->mux){+.+...}, at: [<ffffffffa029c2ec>] ecryptfs_miscdev_read+0x21c/0x470 [ecryptfs]
    
     which lock already depends on the new lock.
    
     the existing dependency chain (in reverse order) is:
    
     -> #1 (&(*daemon)->mux){+.+...}:
            [<ffffffff810a3b8d>] lock_acquire+0x9d/0x220
            [<ffffffff8151c6da>] __mutex_lock_common+0x5a/0x4b0
            [<ffffffff8151cc64>] mutex_lock_nested+0x44/0x50
            [<ffffffffa029c5d7>] ecryptfs_send_miscdev+0x97/0x120 [ecryptfs]
            [<ffffffffa029b744>] ecryptfs_send_message+0x134/0x1e0 [ecryptfs]
            [<ffffffffa029a24e>] ecryptfs_generate_key_packet_set+0x2fe/0xa80 [ecryptfs]
            [<ffffffffa02960f8>] ecryptfs_write_metadata+0x108/0x250 [ecryptfs]
            [<ffffffffa0290f80>] ecryptfs_create+0x130/0x250 [ecryptfs]
            [<ffffffff811963a4>] vfs_create+0xb4/0x120
            [<ffffffff81197865>] do_last+0x8c5/0xa10
            [<ffffffff811998f9>] path_openat+0xd9/0x460
            [<ffffffff81199da2>] do_filp_open+0x42/0xa0
            [<ffffffff81187998>] do_sys_open+0xf8/0x1d0
            [<ffffffff81187a91>] sys_open+0x21/0x30
            [<ffffffff81527d69>] system_call_fastpath+0x16/0x1b
    
     -> #0 (&ecryptfs_msg_ctx_arr[i].mux){+.+.+.}:
            [<ffffffff810a3418>] __lock_acquire+0x1bf8/0x1c50
            [<ffffffff810a3b8d>] lock_acquire+0x9d/0x220
            [<ffffffff8151c6da>] __mutex_lock_common+0x5a/0x4b0
            [<ffffffff8151cc64>] mutex_lock_nested+0x44/0x50
            [<ffffffffa029c213>] ecryptfs_miscdev_read+0x143/0x470 [ecryptfs]
            [<ffffffff811887d3>] vfs_read+0xb3/0x180
            [<ffffffff811888ed>] sys_read+0x4d/0x90
            [<ffffffff81527d69>] system_call_fastpath+0x16/0x1b
    
    Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
  2. eCryptfs: Properly check for O_RDONLY flag before doing privileged open

    Tyler Hicks authored
    If the first attempt at opening the lower file read/write fails,
    eCryptfs will retry using a privileged kthread. However, the privileged
    retry should not happen if the lower file's inode is read-only because a
    read/write open will still be unsuccessful.
    
    The check for determining if the open should be retried was intended to
    be based on the access mode of the lower file's open flags being
    O_RDONLY, but the check was incorrectly performed. This would cause the
    open to be retried by the privileged kthread, resulting in a second
    failed open of the lower file. This patch corrects the check to
    determine if the open request should be handled by the privileged
    kthread.
    
    Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
  3. @torvalds

    Merge branch 'for-linus' of git://git.kernel.dk/linux-block

    torvalds authored
    Pull block bits from Jens Axboe:
     "As vacation is coming up, thought I'd better get rid of my pending
      changes in my for-linus branch for this iteration.  It contains:
    
       - Two patches for mtip32xx.  Killing a non-compliant sysfs interface
         and moving it to debugfs, where it belongs.
    
       - A few patches from Asias.  Two legit bug fixes, and one killing an
         interface that is no longer in use.
    
       - A patch from Jan, making the annoying partition ioctl warning a bit
         less annoying, by restricting it to !CAP_SYS_RAWIO only.
    
       - Three bug fixes for drbd from Lars Ellenberg.
    
       - A fix for an old regression for umem, it hasn't really worked since
         the plugging scheme was changed in 3.0.
    
       - A few fixes from Tejun.
    
       - A splice fix from Eric Dumazet, fixing an issue with pipe
         resizing."
    
    * 'for-linus' of git://git.kernel.dk/linux-block:
      scsi: Silence unnecessary warnings about ioctl to partition
      block: Drop dead function blk_abort_queue()
      block: Mitigate lock unbalance caused by lock switching
      block: Avoid missed wakeup in request waitqueue
      umem: fix up unplugging
      splice: fix racy pipe->buffers uses
      drbd: fix null pointer dereference with on-congestion policy when diskless
      drbd: fix list corruption by failing but already aborted reads
      drbd: fix access of unallocated pages and kernel panic
      xen/blkfront: Add WARN to deal with misbehaving backends.
      blkcg: drop local variable @q from blkg_destroy()
      mtip32xx: Create debugfs entries for troubleshooting
      mtip32xx: Remove 'registers' and 'flags' from sysfs
      blkcg: fix blkg_alloc() failure path
      block: blkcg_policy_cfq shouldn't be used if !CONFIG_CFQ_GROUP_IOSCHED
      block: fix return value on cfq_init() failure
      mtip32xx: Remove version.h header file inclusion
      xen/blkback: Copy id field when doing BLKIF_DISCARD.
  4. cifs: when server doesn't set CAP_LARGE_READ_X, cap default rsize at …

    Jeff Layton authored Steven French committed
    …MaxBufferSize
    
    When the server doesn't advertise CAP_LARGE_READ_X, then MS-CIFS states
    that you must cap the size of the read at the client's MaxBufferSize.
    Unfortunately, testing with many older servers shows that they often
    can't service a read larger than their own MaxBufferSize.
    
    Since we can't assume what the server will do in this situation, we must
    be conservative here for the default. When the server can't do large
    reads, then assume that it can't satisfy any read larger than its
    MaxBufferSize either.
    
    Luckily almost all modern servers can do large reads, so this won't
    affect them. This is really just for older win9x and OS/2 era servers.
    Also, note that this patch just governs the default rsize. The admin can
    always override this if he so chooses.
    
    Cc: <stable@vger.kernel.org> # 3.2
    Reported-by: David H. Durgee <dhdurgee@acm.org>
    Signed-off-by: Jeff Layton <jlayton@redhat.com>
    Signed-off-by: Steven French <sfrench@w500smf.(none)>
Commits on Jul 2, 2012
  1. Btrfs: run delayed directory updates during log replay

    Chris Mason authored
    While we are resolving directory modifications in the
    tree log, we are triggering delayed metadata updates to
    the filesystem btrees.
    
    This commit forces the delayed updates to run so the
    replay code can find any modifications done.  It stops
    us from crashing because the directory deleltion replay
    expects items to be removed immediately from the tree.
    
    Signed-off-by: Chris Mason <chris.mason@fusionio.com>
    cc: stable@kernel.org
  2. Btrfs: hold a ref on the inode during writepages

    Josef Bacik authored Chris Mason committed
    We can race with unlink and not actually be able to do our igrab in
    btrfs_add_ordered_extent.  This will result in all sorts of problems.
    Instead of doing the complicated work to try and handle returning an error
    properly from btrfs_add_ordered_extent, just hold a ref to the inode during
    writepages.  If we cannot grab a ref we know we're freeing this inode anyway
    and can just drop the dirty pages on the floor, because screw them we're
    going to invalidate them anyway.  Thanks,
    
    Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  3. Btrfs: fix tree log remove space corner case

    Josef Bacik authored Chris Mason committed
    The tree log stuff can have allocated space that we end up having split
    across a bitmap and a real extent.  The free space code does not deal with
    this, it assumes that if it finds an extent or bitmap entry that the entire
    range must fall within the entry it finds.  This isn't necessarily the case,
    so rework the remove function so it can handle this case properly.  This
    fixed two panics the user hit, first in the case where the space was
    initially in a bitmap and then in an extent entry, and then the reverse
    case.  Thanks,
    
    Reported-and-tested-by: Shaun Reich <sreich@kde.org>
    Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  4. @liub

    Btrfs: fix wrong check during log recovery

    liub authored Chris Mason committed
    When we're evicting an inode during log recovery, we need to ensure that the inode
    is not in orphan state any more, which means inode's run_time flags has _no_
    BTRFS_INODE_HAS_ORPHAN_ITEM.  Thus, the BUG_ON was triggered because of a wrong
    check for the flags.
    
    Reviewed-by: David Sterba <dsterba@suse.cz>
    Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
    Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  5. Btrfs: use _IOR for BTRFS_IOC_SUBVOL_GETFLAGS

    Alexander Block authored Chris Mason committed
    We used the wrong ioctl macro for the getflags ioctl before.
    As we don't have the set/getflags ioctls in the user space ioctl.h
    at the moment, it's safe to fix it now.
    
    Reviewed-by: David Sterba <dsterba@suse.cz>
    Signed-off-by: Alexander Block <ablock84@googlemail.com>
  6. @idryomov

    Btrfs: resume balance on rw (re)mounts properly

    idryomov authored Chris Mason committed
    This introduces btrfs_resume_balance_async(), which, given that
    restriper state was recovered earlier by btrfs_recover_balance(),
    resumes balance in btrfs-balance kthread.
    
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  7. @idryomov

    Btrfs: restore restriper state on all mounts

    idryomov authored Chris Mason committed
    Fix a bug that triggered asserts in btrfs_balance() in both normal and
    resume modes -- restriper state was not properly restored on read-only
    mounts.  This factors out resuming code from btrfs_restore_balance(),
    which is now also called earlier in the mount sequence to avoid the
    problem of some early writes getting the old profile.
    
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  8. Btrfs: fix dio write vs buffered read race

    Josef Bacik authored Chris Mason committed
    Miao pointed out there's a problem with mixing dio writes and buffered
    reads.  If the read happens between us invalidating the page range and
    actually locking the extent we can bring in pages into page cache.  Then
    once the write finishes if somebody tries to read again it will just find
    uptodate pages and we'll read stale data.  So we need to lock the extent and
    check for uptodate bits in the range.  If there are uptodate bits we need to
    unlock and invalidate again.  This will keep this race from happening since
    we will hold the extent locked until we create the ordered extent, and then
    teh read side always waits for ordered extents.  There was also a race in
    how we updated i_size, previously we were relying on the generic DIO stuff
    to adjust the i_size after the DIO had completed, but this happens outside
    of the extent lock which means reads could come in and not see the updated
    i_size.  So instead move this work into where we create the extents, and
    then this way the update ordered i_size stuff works properly in the endio
    handlers.  Thanks,
    
    Signed-off-by: Josef Bacik <josef@redhat.com>
  9. Btrfs: don't count I/O statistic read errors for missing devices

    Stefan Behrens authored Chris Mason committed
    It is normal behaviour of the low level btrfs function btrfs_map_bio()
    to complete a bio with -EIO if the device is missing, instead of just
    preventing the bio creation in an earlier step.
    This used to cause I/O statistic read error increments and annoying
    printk_ratelimited messages. This commit fixes the issue.
    
    Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
    Reported-by: Carey Underwood <cwillu@cwillu.com>
Commits on Jun 28, 2012
  1. @torvalds

    Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel…

    torvalds authored
    …/git/jack/linux-fs
    
    Pull UDF fixes from Jan Kara:
     "Make UDF more robust in presence of corrupted filesystem"
    
    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
      udf: Fortify loading of sparing table
      udf: Avoid run away loop when partition table length is corrupted
      udf: Use 'ret' instead of abusing 'i' in udf_load_logicalvol()
  2. @torvalds

    Merge tag 'upstream-3.5-rc5' of git://git.infradead.org/linux-ubifs

    torvalds authored
    Pull ubi/ubifs fixes from Artem Bityutskiy:
     "Fix the debugfs regression - we never enable it because incorrect
      'IS_ENABLED()' macro usage: should be 'IS_ENABLED(CONFIG_DEBUG_FS)',
      but we had 'IS_ENABLED(DEBUG_FS)'.  Also fix incorrect assertion."
    
    * tag 'upstream-3.5-rc5' of git://git.infradead.org/linux-ubifs:
      UBI: correct usage of IS_ENABLED()
      UBIFS: correct usage of IS_ENABLED()
      UBIFS: fix assertion
  3. @jankara

    udf: Fortify loading of sparing table

    jankara authored
    Add sanity checks when loading sparing table from disk to avoid accessing
    unallocated memory or writing to it.
    
    Signed-off-by: Jan Kara <jack@suse.cz>
Something went wrong with that request. Please try again.