16 Nov, 2011

2 commits


09 Nov, 2011

1 commit


08 Nov, 2011

12 commits

  • Hash lockowners on just the owner string rather than on (owner, inode).
    This makes the owner-string lookup needed for RELEASE_LOCKOWNER simpler
    (currently it's doing at a linear search through the entire hash
    table!). That may come at the expense of making (owner, inode) lookups
    more expensive if a client reuses the same lockowner across multiple
    files. We might add a separate lookup for that.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • The close parenthesis was hard to find with it spaced so far over.

    Signed-off-by: Bryan Schumaker
    [bfields@redhat.com: get all these lines under 80 chars while we're here]
    Signed-off-by: J. Bruce Fields

    Bryan Schumaker
     
  • init_nfsd() was calling free_slabs() during cleanup code, but the call
    to init_slabs() was hidden in nfsd4_state_init(). This could be
    confusing to people unfamiliar with the code.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: J. Bruce Fields

    Bryan Schumaker
     
  • Fault injection on the NFS server makes it easier to test the client's
    state manager and recovery threads. Simulating errors on the server is
    easier than finding the right conditions that cause them naturally.

    This patch uses debugfs to add a simple framework for fault injection to
    the server. This framework is a config option, and can be enabled
    through CONFIG_NFSD_FAULT_INJECTION. Assuming you have debugfs mounted
    to /sys/debug, a set of files will be created in /sys/debug/nfsd/.
    Writing to any of these files will cause the corresponding action and
    write a log entry to dmesg.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: J. Bruce Fields

    Bryan Schumaker
     
  • Instead of creating a new lockowner and stateid for every
    open_to_lockowner call, reuse the existing lockowner if it exists.

    Reported-by: Trond Myklebust
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • I'd rather the "ignore clientid in sessions case" rule be enforced in
    just one place.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Lockowners are looked up by file as well as by owner, but we were
    forgetting to do a comparison on the file. This could cause an
    incorrect result from lockt.

    (Note looking up the inode from the lockowner is pretty awkward here.
    The data structures need fixing.)

    Cc: stable@kernel.org
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Mountpoint crossing is similar to following procfs symlinks - we do
    not get ->d_revalidate() called for dentry we have arrived at, with
    unpleasant consequences for NFS4.

    Simple way to reproduce the problem in mainline:

    cat >/tmp/a.c <
    #include
    #include
    main()
    {
    struct flock fl = {.l_type = F_RDLCK, .l_whence = SEEK_SET, .l_len = 1};
    if (fcntl(0, F_SETLK, &fl))
    perror("setlk");
    }
    EOF
    cc /tmp/a.c -o /tmp/test

    then on nfs4:

    mount --bind file1 file2
    /tmp/test < file1 # ok
    /tmp/test < file2 # spews "setlk: No locks available"...

    What happens is the missing call of ->d_revalidate() after mountpoint
    crossing and that's where NFS4 would issue OPEN request to server.

    The fix is simple - treat mountpoint crossing the same way we deal with
    following procfs-style symlinks. I.e. set LOOKUP_JUMPED...

    Cc: stable@kernel.org
    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • * git://git.samba.org/sfrench/cifs-2.6:
    CIFS: Cleanup byte-range locking code style
    CIFS: Simplify setlk error handling for mandatory locking

    Linus Torvalds
     
  • * git://git.infradead.org/mtd-2.6: (226 commits)
    mtd: tests: annotate as DANGEROUS in Kconfig
    mtd: tests: don't use mtd0 as a default
    mtd: clean up usage of MTD_DOCPROBE_ADDRESS
    jffs2: add compr=lzo and compr=zlib options
    jffs2: implement mount option parsing and compression overriding
    mtd: nand: initialize ops.mode
    mtd: provide an alias for the redboot module name
    mtd: m25p80: don't probe device which has status of 'disabled'
    mtd: nand_h1900 never worked
    mtd: Add DiskOnChip G3 support
    mtd: m25p80: add EON flash EN25Q32B into spi flash id table
    mtd: mark block device queue as non-rotational
    mtd: r852: make r852_pm_ops static
    mtd: m25p80: add support for at25df321a spi data flash
    mtd: mxc_nand: preset_v1_v2: unlock all NAND flash blocks
    mtd: nand: switch `check_pattern()' to standard `memcmp()'
    mtd: nand: invalidate cache on unaligned reads
    mtd: nand: do not scan bad blocks with NAND_BBT_NO_OOB set
    mtd: nand: wait to set BBT version
    mtd: nand: scrub BBT on ECC errors
    ...

    Fix up trivial conflicts:
    - arch/arm/mach-at91/board-usb-a9260.c
    Merged into board-usb-a926x.c
    - drivers/mtd/maps/lantiq-flash.c
    add_mtd_partitions -> mtd_device_register vs changed to use
    mtd_device_parse_register.

    Linus Torvalds
     
  • * 'linux-next' of git://git.infradead.org/ubifs-2.6:
    UBIFS: fix the dark space calculation
    UBIFS: introduce a helper to dump scanning info

    Linus Torvalds
     

07 Nov, 2011

5 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (114 commits)
    Btrfs: check for a null fs root when writing to the backup root log
    Btrfs: fix race during transaction joins
    Btrfs: fix a potential btrfs_bio leak on scrub fixups
    Btrfs: rename btrfs_bio multi -> bbio for consistency
    Btrfs: stop leaking btrfs_bios on readahead
    Btrfs: stop the readahead threads on failed mount
    Btrfs: fix extent_buffer leak in the metadata IO error handling
    Btrfs: fix the new inspection ioctls for 32 bit compat
    Btrfs: fix delayed insertion reservation
    Btrfs: ClearPageError during writepage and clean_tree_block
    Btrfs: be smarter about committing the transaction in reserve_metadata_bytes
    Btrfs: make a delayed_block_rsv for the delayed item insertion
    Btrfs: add a log of past tree roots
    btrfs: separate superblock items out of fs_info
    Btrfs: use the global reserve when truncating the free space cache inode
    Btrfs: release metadata from global reserve if we have to fallback for unlink
    Btrfs: make sure to flush queued bios if write_cache_pages waits
    Btrfs: fix extent pinning bugs in the tree log
    Btrfs: make sure btrfs_remove_free_space doesn't leak EAGAIN
    Btrfs: don't wait as long for more batches during SSD log commit
    ...

    Linus Torvalds
     
  • * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
    Revert "tracing: Include module.h in define_trace.h"
    irq: don't put module.h into irq.h for tracking irqgen modules.
    bluetooth: macroize two small inlines to avoid module.h
    ip_vs.h: fix implicit use of module_get/module_put from module.h
    nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
    include: replace linux/module.h with "struct module" wherever possible
    include: convert various register fcns to macros to avoid include chaining
    crypto.h: remove unused crypto_tfm_alg_modname() inline
    uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
    pm_runtime.h: explicitly requires notifier.h
    linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
    miscdevice.h: fix up implicit use of lists and types
    stop_machine.h: fix implicit use of smp.h for smp_processor_id
    of: fix implicit use of errno.h in include/linux/of.h
    of_platform.h: delete needless include
    acpi: remove module.h include from platform/aclinux.h
    miscdevice.h: delete unnecessary inclusion of module.h
    device_cgroup.h: delete needless include
    net: sch_generic remove redundant use of
    net: inet_timewait_sock doesnt need
    ...

    Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
    - drivers/media/dvb/frontends/dibx000_common.c
    - drivers/media/video/{mt9m111.c,ov6650.c}
    - drivers/mfd/ab3550-core.c
    - include/linux/dmaengine.h

    Linus Torvalds
     
  • * 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
    writeback: Add a 'reason' to wb_writeback_work
    writeback: send work item to queue_io, move_expired_inodes
    writeback: trace event balance_dirty_pages
    writeback: trace event bdi_dirty_ratelimit
    writeback: fix ppc compile warnings on do_div(long long, unsigned long)
    writeback: per-bdi background threshold
    writeback: dirty position control - bdi reserve area
    writeback: control dirty pause time
    writeback: limit max dirty pause time
    writeback: IO-less balance_dirty_pages()
    writeback: per task dirty rate limit
    writeback: stabilize bdi->dirty_ratelimit
    writeback: dirty rate control
    writeback: add bg_threshold parameter to __bdi_update_bandwidth()
    writeback: dirty position control
    writeback: account per-bdi accumulated dirtied pages

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
    ceph/super.c: quiet sparse noise
    ceph/mds_client.c: quiet sparse noise
    ceph: use new D_COMPLETE dentry flag
    ceph: clear parent D_COMPLETE flag when on dentry prune

    Linus Torvalds
     
  • During log replay, can commit the transaction before the fs_root
    pointers are setup, so we have to make sure they are not null before
    trying to use them.

    Signed-off-by: Chris Mason

    Chris Mason
     

06 Nov, 2011

20 commits

  • While we're allocating ram for a new transaction, we drop our spinlock.
    When we get the lock back, we do check to see if a transaction started
    while we slept, but we don't check to make sure it isn't blocked
    because a commit has already started.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • In case we were able to map less than we wanted (length < PAGE_SIZE
    clause is true) btrfs_bio is still allocated and we have to free it.

    Signed-off-by: Ilya Dryomov
    Signed-off-by: Chris Mason

    Ilya Dryomov
     
  • Signed-off-by: Chris Mason

    Ilya Dryomov
     
  • Signed-off-by: Chris Mason

    Ilya Dryomov
     
  • If we don't stop them, they linger around corrupting
    memory by using pointers to freed things.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • The scrub readahead branch brought in a new error handling hook,
    but it was leaking extent_buffer references.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • The new ioctls to follow backrefs are not clean for 32/64 bit
    compat. This reworks them for u64s everywhere. They are brand new, so
    there are no problems with changing the interface now.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • Conflicts:
    fs/btrfs/Makefile
    fs/btrfs/extent_io.c
    fs/btrfs/extent_io.h
    fs/btrfs/scrub.c

    Signed-off-by: Chris Mason

    Chris Mason
     
  • Conflicts:
    fs/btrfs/ctree.h

    Signed-off-by: Chris Mason

    Chris Mason
     
  • We all keep getting those stupid warnings from use_block_rsv when running
    stress.sh, and it's because the delayed insertion stuff is being stupid. It's
    not the delayed insertion stuffs fault, it's all just stupid. When marking an
    inode dirty for oh say updating the time on it, we just do a
    btrfs_join_transaction, which doesn't reserve any space. This is stupid because
    we're going to have to have space reserve to make this change, but we do it
    because it's fast because chances are we're going to call it over and over again
    and it doesn't matter. Well thanks to the delayed insertion stuff this is
    mostly the case, so we do actually need to make this reservation. So if
    trans->bytes_reserved is 0 then try to do a normal reservation. If not return
    ENOSPC which will make the btrfs_dirty_inode start a proper transaction which
    will let it do the whole ENOSPC dance and reserve enough space for the delayed
    insertion to steal the reservation from the transaction.

    The other stupid thing we do is not reserve space for the inode when writing to
    the thing. Usually this is ok since we have to update the time so we'd have
    already done all this work before we get to the endio stuff, so it doesn't
    matter. But this is stupid because we could write the data after the
    transaction commits where we changed the mtime of the inode so we have to cow
    all the way down to the inode anyway. This used to be masked by the delalloc
    reservation stuff, but because we delay the update it doesn't get masked in this
    case. So again the delayed insertion stuff bites us in the ass. So if our
    trans->block_rsv is delalloc, just steal the reservation from the delalloc
    reserve. Hopefully this won't bite us in the ass, but I've said that before.

    With this patch stress.sh no longer spits out those stupid warnings (famous last
    words). Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • Failure testing was tripping up over stale PageError bits in
    metadata pages. If we have an io error on a block, and later on
    end up reusing it, nobody ever clears PageError on those pages.

    During commit, we'll find PageError and think we had trouble writing
    the block, which will lead to aborts and other problems.

    This changes clean_tree_block and the btrfs writepage code to
    clear the PageError bit. In both cases we're either completely
    done with the page or the page has good stuff and the error bit
    is no longer valid.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • Because of the overcommit stuff I had to make it so that we committed the
    transaction all the time in reserve_metadata_bytes in case we had overcommitted
    because of delayed items. This was because previously we had no way of knowing
    how much space was reserved for delayed items. Now that we have the
    delayed_block_rsv we can check it to see if committing the transaction would get
    us anywhere. This patch breaks out the committing logic into a helper function
    that will check to see if committing the transaction would free enough space for
    us to get anything done. With this patch xfstests 83 goes from taking 445
    seconds to taking 28 seconds on my box. Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • I've been hitting warnings in use_block_rsv when running the delayed insertion
    stuff. It's because we will readjust global block rsv based on what is in use,
    which means we could end up discarding reservations that are for the delayed
    insertion stuff. So instead create a seperate block rsv for the delayed
    insertion stuff. This will also make it easier to debug problems with the
    delayed insertion reservations since we will know that only the delayed
    insertion code touches this block_rsv. Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • This takes some of the free space in the btrfs super block
    to record information about most of the roots in the last four
    commits.

    It also adds a -o recovery to use the root history log when
    we're not able to read the tree of tree roots, the extent
    tree root, the device tree root or the csum root.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • fs_info has now ~9kb, more than fits into one page. This will cause
    mount failure when memory is too fragmented. Top space consumers are
    super block structures super_copy and super_for_commit, ~2.8kb each.
    Allocate them dynamically. fs_info will be ~3.5kb. (measured on x86_64)

    Add a wrapper for freeing fs_info and all of it's dynamically allocated
    members.

    Signed-off-by: David Sterba

    David Sterba
     
  • We no longer use the orphan block rsv for holding the reservation for truncating
    the inode, so instead use the global block rsv and check to make sure it has
    enough space for us to truncate the space. Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • I fixed a problem where we weren't reserving space for an orphan item when we
    had to fallback to using the global reserve for an unlink, but I introduced
    another problem. I was migrating the bytes from the transaction reserve to the
    global reserve and then releasing from the global reserve in
    btrfs_end_transaction(). The problem with this is that a migrate will jack up
    the size for the destination, but leave the size alone for the source, with the
    idea that you can do a release normally on the source and it all washes out, and
    then you can do a release again on the destination and it works out right. My
    way was skipping the release on the trans_block_rsv which still had the jacked
    up size from our original reservation. So instead release manually from the
    global reserve if this transaction was using it, and then set the
    trans->block_rsv back to the trans_block_rsv so that btrfs_end_transaction
    cleans everything up properly. With this patch xfstest 83 doesn't emit warnings
    about leaking space. Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     
  • write_cache_pages tries to build up a large bio to stuff down the pipe.
    But if it needs to wait for a page lock, it needs to make sure and send
    down any pending writes so we don't deadlock with anyone who has the
    page lock and is waiting for writeback of things inside the bio.

    Dave Sterba triggered this as a deadlock between the autodefrag code and
    the extent write_cache_pages

    Signed-off-by: Chris Mason

    Chris Mason
     
  • The tree log had two important bugs that could cause corruptions after a
    crash. Sometimes we were allowing tree log blocks to be reused after
    the tree log was committed but before the transaction commit was done.

    This allowed a future metadata write to overwrite the tree log data. It
    is fixed by adding a new variant of freeing reserved extents that always
    pins them. Credit goes to Stefan Behrens and Arne Jansen for many many
    hours spent tracking this bug down.

    During tree log replay, we do a pass through the tree log and pin all
    the extents we find. This makes sure the replay code won't go in and
    use any of those blocks for new allocations during replay. The problem
    is the free space cache isn't honoring these pinned extents. So the
    allocator can end up handing them out, leading to all kinds of problems
    during replay.

    The fix here is to force any free space cache to load while we pin the
    extents, and then to make sure we remove the pinned extents from the
    free space rbtree.

    Signed-off-by: Chris Mason
    Reported-by: Stefan Behrens

    Chris Mason
     
  • btrfs_remove_free_space needs to make sure to set ret back to a
    valid return value after setting it to EAGAIN, otherwise we return
    it to the callers.

    Signed-off-by: Chris Mason

    Chris Mason