27 Jul, 2010

22 commits

  • The tracing code can't print flags defined as enums. Most flags that
    we want to print are defines as macros already, but move the few remaining
    ones over to make the trace output more useful.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • On the final put of a superblock the VFS already calls sync_filesystem
    for us to write out all data and wait for it. No need to start another
    asynchronous writeback inside ->put_super.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Remove the flags argument to __xfs_get_blocks as we can easily derive
    it from the direct argument, and remove the unused BMAPI_MMAP flag.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • xfs_iomap passes a xfs_bmbt_irec pointer to xfs_iomap_write_direct and
    xfs_iomap_write_allocate to give them the results of our read-only
    xfs_bmapi query. Instead of allocating a new xfs_bmbt_irec on stack
    for the next call to xfs_bmapi re use the one we got passed as it's not
    used after this point.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • We already rely on the fact that the sync code will cause a synchronous
    log force later on (currently via xfs_fs_sync_fs -> xfs_quiesce_data ->
    xfs_sync_data), so no need to do this here. This allows us to avoid
    a lot of synchronous log forces during sync, which pays of especially
    with delayed logging enabled. Some compilebench numbers that show
    this:

    xfs (delayed logging, 256k logbufs)
    ===================================

    intial create 25.94 MB/s 25.75 MB/s 25.64 MB/s
    create 8.54 MB/s 9.12 MB/s 9.15 MB/s
    patch 2.47 MB/s 2.47 MB/s 3.17 MB/s
    compile 29.65 MB/s 30.51 MB/s 27.33 MB/s
    clean 90.92 MB/s 98.83 MB/s 128.87 MB/s
    read tree 11.90 MB/s 11.84 MB/s 8.56 MB/s
    read compiled 28.75 MB/s 29.96 MB/s 24.25 MB/s
    delete tree 8.39 seconds 8.12 seconds 8.46 seconds
    delete compiled 8.35 seconds 8.44 seconds 5.11 seconds
    stat tree 6.03 seconds 5.59 seconds 5.19 seconds
    stat compiled tree 9.00 seconds 9.52 seconds 8.49 seconds

    xfs + write_inode log_force removal
    ===================================
    intial create 25.87 MB/s 25.76 MB/s 25.87 MB/s
    create 15.18 MB/s 14.80 MB/s 14.94 MB/s
    patch 3.13 MB/s 3.14 MB/s 3.11 MB/s
    compile 36.74 MB/s 37.17 MB/s 36.84 MB/s
    clean 226.02 MB/s 222.58 MB/s 217.94 MB/s
    read tree 15.14 MB/s 15.02 MB/s 15.14 MB/s
    read compiled tree 29.30 MB/s 29.31 MB/s 29.32 MB/s
    delete tree 6.22 seconds 6.14 seconds 6.15 seconds
    delete compiled tree 5.75 seconds 5.92 seconds 5.81 seconds
    stat tree 4.60 seconds 4.51 seconds 4.56 seconds
    stat compiled tree 4.07 seconds 3.87 seconds 3.96 seconds

    In addition to that also remove the delwri inode flush that is unessecary
    now that bulkstat is always coherent.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • The writepage implementation in XFS still tries to deal with dirty but
    unmapped buffers which used to caused by writes through shared mmaps. Since
    the introduction of ->page_mkwrite these can't happen anymore, so remove the
    code dealing with them.

    Note that the all_bh variable which causes us to start I/O on all buffers on
    the pages was controlled by the count of unmapped buffers, which also
    included those not actually dirty. It's now unconditionally initialized to
    0 but set to 1 for the case of small file size extensions. It probably can
    be removed entirely, but that's left for another patch.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Currently the xfs releasepage implementation has code to deal with converting
    delayed allocated and unwritten space. But we never get called for those as
    we always convert delayed and unwritten space when cleaning a page, or drop
    the state from the buffers in block_invalidatepage. We still keep a WARN_ON
    on those cases for now, but remove all the case dealing with it, which allows
    to fold xfs_page_state_convert into xfs_vm_writepage and remove the !startio
    case from the whole writeback path.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • xfstests 194 first truncats a file back and then extends it again by
    truncating it to a larger size. This causes discard_buffer to drop
    the mapped, but not the uptodate bit and thus creates something that
    xfs_page_state_convert takes for unmapped space created by mmap because
    it doesn't check for the dirty bit, which also gets cleared by
    discard_buffer and checked by other ->writepage implementations like
    block_write_full_page. Handle this kind of buffers early, and unlike
    Eric's first version of the patch simply ASSERT that the buffers is
    dirty, given that the mmap write case can't happen anymore since the
    introduction of ->page_mkwrite. The now dead code dealing with that
    will be deleted in a follow on patch.

    Signed-off-by: Eric Sandeen
    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Eric Sandeen
     
  • This code was introduced four years ago in commit
    3e57ecf640428c01ba1ed8c8fc538447ada1715b without any review and has
    been unused since. Remove it just as the rest of the code introduced
    in that commit to reduce that stack usage and complexity in this central
    piece of code.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • By making this member a void pointer we can get rid of a lot of pointless
    casts.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Currently we need to either call IHOLD or xfs_trans_ihold on an inode when
    joining it to a transaction via xfs_trans_ijoin.

    This patches instead makes xfs_trans_ijoin usable on it's own by doing
    an implicity xfs_trans_ihold, which also allows us to drop the third
    argument. For the case where we want to hold a reference on the inode
    a xfs_trans_ijoin_ref wrapper is added which does the IHOLD and marks
    the inode for needing an xfs_iput. In addition to the cleaner interface
    to the caller this also simplifies the implementation.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Get rid of the xfs_buf_pin/xfs_buf_unpin/xfs_buf_ispin helpers and opencode
    them in their only callers, just like we did for the inode pinning a while
    ago. Also remove duplicate trace points - the bufitem tracepoints cover
    all the information that is present in a buffer tracepoint.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Stop the function pointer casting madness and give all the li_cb instances
    correct prototype.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Stop the function pointer casting madness and give all the xfs_item_ops the
    correct prototypes.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • The unpin_remove item operation instances always share most of the
    implementation with the respective unpin implementation. So instead
    of keeping two different entry points add a remove flag to the unpin
    operation and share the code more easily.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Currently we track log item descriptor belonging to a transaction using a
    complex opencoded chunk allocator. This code has been there since day one
    and seems to work around the lack of an efficient slab allocator.

    This patch replaces it with dynamically allocated log item descriptors
    from a dedicated slab pool, linked to the transaction by a linked list.

    This allows to greatly simplify the log item descriptor tracking to the
    point where it's just a couple hundred lines in xfs_trans.c instead of
    a separate file. The external API has also been simplified while we're
    at it - the xfs_trans_add_item and xfs_trans_del_item functions to add/
    delete items from a transaction have been simplified to the bare minium,
    and the xfs_trans_find_item function is replaced with a direct dereference
    of the li_desc field. All debug code walking the list of log items in
    a transaction is down to a simple list_for_each_entry.

    Note that we could easily use a singly linked list here instead of the
    double linked list from list.h as the fastpath only does deletion from
    sequential traversal. But given that we don't have one available as
    a library function yet I use the list.h functions for simplicity.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     
  • Dmapi support was never merged upstream, but we still have a lot of hooks
    bloating XFS for it, all over the fast pathes of the filesystem.

    This patch drops over 700 lines of dmapi overhead. If we'll ever get HSM
    support in mainline at least the namespace events can be done much saner
    in the VFS instead of the individual filesystem, so it's not like this
    is much help for future work.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Dave Chinner

    Christoph Hellwig
     

23 Jul, 2010

7 commits

  • Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: synaptics - relax capability ID checks on newer hardware
    Input: twl40300-keypad - fix handling of "all ground" rows
    Input: gamecon - reference correct pad in gc_psx_command()
    Input: gamecon - reference correct input device in NES mode
    Input: w90p910_keypad - change platfrom driver name to 'nuc900-kpi'
    Input: i8042 - add Gigabyte Spring Peak to dmi_noloop_table
    Input: qt2160 - rename kconfig symbol name

    Linus Torvalds
     
  • * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
    drm/radeon/kms: add quirk to make HP DV5000 laptop resume
    drm/radeon/kms: fix RADEON_INFO_CRTC_FROM_ID info ioctl
    Fix ttm_page_alloc.c build breakage
    drm/radeon/kms: fix legacy LVDS dpms sequence
    drm/radeon/kms: drop taking lock around crtc lookup.

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: talitos - fix bug in sg_copy_end_to_buffer

    Linus Torvalds
     
  • …/frob/linux-2.6-roland

    * 'x86/auditsyscall' of git://git.kernel.org/pub/scm/linux/kernel/git/frob/linux-2.6-roland:
    x86: auditsyscall: fix fastpath return value after reschedule

    Linus Torvalds
     
  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
    sysrq,kdb: Use __handle_sysrq() for kdb's sysrq function
    debug_core,kdb: fix kgdb_connected bit set in the wrong place
    Fix merge regression from external kdb to upstream kdb
    repair gdbstub to match the gdbserial protocol specification
    kdb: break out of kdb_ll() when command is terminated

    Linus Torvalds
     
  • Fix the security problem in the CIFS filesystem DNS lookup code in which a
    malicious redirect could be installed by a random user by simply adding a
    result record into one of their keyrings with add_key() and then invoking a
    CIFS CFS lookup [CVE-2010-2524].

    This is done by creating an internal keyring specifically for the caching of
    DNS lookups. To enforce the use of this keyring, the module init routine
    creates a set of override credentials with the keyring installed as the thread
    keyring and instructs request_key() to only install lookup result keys in that
    keyring.

    The override is then applied around the call to request_key().

    This has some additional benefits when a kernel service uses this module to
    request a key:

    (1) The result keys are owned by root, not the user that caused the lookup.

    (2) The result keys don't pop up in the user's keyrings.

    (3) The result keys don't come out of the quota of the user that caused the
    lookup.

    The keyring can be viewed as root by doing cat /proc/keys:

    2a0ca6c3 I----- 1 perm 1f030000 0 0 keyring .dns_resolver: 1/4

    It can then be listed with 'keyctl list' by root.

    # keyctl list 0x2a0ca6c3
    1 key in keyring:
    726766307: --alswrv 0 0 dns_resolver: foo.bar.com

    Signed-off-by: David Howells
    Reviewed-and-Tested-by: Jeff Layton
    Acked-by: Steve French
    Signed-off-by: Linus Torvalds

    David Howells
     

22 Jul, 2010

11 commits