17 Dec, 2009

37 commits

  • * 'for-linus' of git://oss.sgi.com/xfs/xfs:
    XFS: Free buffer pages array unconditionally
    xfs: kill xfs_bmbt_rec_32/64 types
    xfs: improve metadata I/O merging in the elevator
    xfs: check for not fully initialized inodes in xfs_ireclaim

    Linus Torvalds
     
  • Commit 3d1e4631 ("get rid of init_file()") removed the export of
    alloc_file() -- possibly inadvertently, since that commit mainly
    consisted of deleting the lines between the end of alloc_file() and
    the start of the code in init_file().

    There is in fact one modular use of alloc_file() in the tree, in
    drivers/infiniband/core/uverbs_main.c, so re-add the export to fix:

    ERROR: "alloc_file" [drivers/infiniband/core/ib_uverbs.ko] undefined!

    when CONFIG_INFINIBAND_USER_ACCESS=m.

    Cc: Al Viro
    Signed-off-by: Roland Dreier
    Signed-off-by: Linus Torvalds

    Roland Dreier
     
  • * 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6: (34 commits)
    HWPOISON: Remove stray phrase in a comment
    HWPOISON: Try to allocate migration page on the same node
    HWPOISON: Don't do early filtering if filter is disabled
    HWPOISON: Add a madvise() injector for soft page offlining
    HWPOISON: Add soft page offline support
    HWPOISON: Undefine short-hand macros after use to avoid namespace conflict
    HWPOISON: Use new shake_page in memory_failure
    HWPOISON: Use correct name for MADV_HWPOISON in documentation
    HWPOISON: mention HWPoison in Kconfig entry
    HWPOISON: Use get_user_page_fast in hwpoison madvise
    HWPOISON: add an interface to switch off/on all the page filters
    HWPOISON: add memory cgroup filter
    memcg: add accessor to mem_cgroup.css
    memcg: rename and export try_get_mem_cgroup_from_page()
    HWPOISON: add page flags filter
    mm: export stable page flags
    HWPOISON: limit hwpoison injector to known page types
    HWPOISON: add fs/device filters
    HWPOISON: return 0 to indicate success reliably
    HWPOISON: make semantics of IGNORED/DELAYED clear
    ...

    Linus Torvalds
     
  • * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (38 commits)
    direct I/O fallback sync simplification
    ocfs: stop using do_sync_mapping_range
    cleanup blockdev_direct_IO locking
    make generic_acl slightly more generic
    sanitize xattr handler prototypes
    libfs: move EXPORT_SYMBOL for d_alloc_name
    vfs: force reval of target when following LAST_BIND symlinks (try #7)
    ima: limit imbalance msg
    Untangling ima mess, part 3: kill dead code in ima
    Untangling ima mess, part 2: deal with counters
    Untangling ima mess, part 1: alloc_file()
    O_TRUNC open shouldn't fail after file truncation
    ima: call ima_inode_free ima_inode_free
    IMA: clean up the IMA counts updating code
    ima: only insert at inode creation time
    ima: valid return code from ima_inode_alloc
    fs: move get_empty_filp() deffinition to internal.h
    Sanitize exec_permission_lite()
    Kill cached_lookup() and real_lookup()
    Kill path_lookup_open()
    ...

    Trivial conflicts in fs/direct-io.c

    Linus Torvalds
     
  • The code in xfs_free_buf() only attempts to free the b_pages array if the
    buffer is a page cache backed or page allocated buffer. The extra log buffer
    that is used when the log wraps uses pages that are allocated to a different
    log buffer, but it still has a b_pages array allocated when those pages
    are associated to with the extra buffer in xfs_buf_associate_memory.

    Hence we need to always attempt to free the b_pages array when tearing
    down a buffer, not just on buffers that are explicitly marked as page bearing
    buffers. This fixes a leak detected by the kernel memory leak code.

    Signed-off-by: Dave Chinner
    Signed-off-by: Alex Elder

    Dave Chinner
     
  • For a long time we've always stored bmap btree records in the 64bit format,
    so kill off the dead 32bit type, and make sure the 64bit type is named just
    xfs_bmbt_rec everywhere, without any size postfix.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Eric Sandeen
    Signed-off-by: Alex Elder

    Christoph Hellwig
     
  • Change all async metadata buffers to use [READ|WRITE]_META I/O types
    so that the I/O doesn't get issued immediately. This allows merging of
    adjacent metadata requests but still prioritises them over bulk data.
    This shows a 10-15% improvement in sequential create speed of small
    files.

    Don't include the log buffers in this classification - leave them as
    sync types so they are issued immediately.

    Signed-off-by: Dave Chinner
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Alex Elder

    Dave Chinner
     
  • Add an assert for inodes not added to the inode cache in xfs_ireclaim,
    to make sure we're not going to introduce something like the
    famous nfsd inode cache bug again.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Alex Elder

    Christoph Hellwig
     
  • * 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
    NFSv4: Fix a regression in the NFSv4 state manager
    NFSv4: Release the sequence id before restarting a CLOSE rpc call
    nfs41: fix session fore channel negotiation
    nfs41: do not zero seqid portion of stateid on close
    nfs: run state manager in privileged mode
    nfs: make recovery state manager operations privileged
    nfs: enforce FIFO ordering of operations trying to acquire slot
    rpc: add a new priority in RPC task
    nfs: remove rpc_task argument from nfs4_find_slot
    rpc: add rpc_queue_empty function
    nfs: change nfs4_do_setlk params to identify recovery type
    nfs: do not do a LOOKUP after open
    nfs: minor cleanup of session draining

    Linus Torvalds
     
  • * 'for-2.6.33' of git://linux-nfs.org/~bfields/linux: (42 commits)
    nfsd: remove pointless paths in file headers
    nfsd: move most of nfsfh.h to fs/nfsd
    nfsd: remove unused field rq_reffh
    nfsd: enable V4ROOT exports
    nfsd: make V4ROOT exports read-only
    nfsd: restrict filehandles accepted in V4ROOT case
    nfsd: allow exports of symlinks
    nfsd: filter readdir results in V4ROOT case
    nfsd: filter lookup results in V4ROOT case
    nfsd4: don't continue "under" mounts in V4ROOT case
    nfsd: introduce export flag for v4 pseudoroot
    nfsd: let "insecure" flag vary by pseudoflavor
    nfsd: new interface to advertise export features
    nfsd: Move private headers to source directory
    vfs: nfsctl.c un-used nfsd #includes
    lockd: Remove un-used nfsd headers #includes
    s390: remove un-used nfsd #includes
    sparc: remove un-used nfsd #includes
    parsic: remove un-used nfsd #includes
    compat.c: Remove dependence on nfsd private headers
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6:
    fat: make discard a mount option

    Linus Torvalds
     
  • * git://git.infradead.org/mtd-2.6: (90 commits)
    jffs2: Fix long-standing bug with symlink garbage collection.
    mtd: OneNAND: Fix test of unsigned in onenand_otp_walk()
    mtd: cfi_cmdset_0002, fix lock imbalance
    Revert "mtd: move mxcnd_remove to .exit.text"
    mtd: m25p80: add support for Macronix MX25L4005A
    kmsg_dump: fix build for CONFIG_PRINTK=n
    mtd: nandsim: add support for 4KiB pages
    mtd: mtdoops: refactor as a kmsg_dumper
    mtd: mtdoops: make record size configurable
    mtd: mtdoops: limit the maximum mtd partition size
    mtd: mtdoops: keep track of used/unused pages in an array
    mtd: mtdoops: several minor cleanups
    core: Add kernel message dumper to call on oopses and panics
    mtd: add ARM pismo support
    mtd: pxa3xx_nand: Fix PIO data transfer
    mtd: nand: fix multi-chip suspend problem
    mtd: add support for switching old SST chips into QRY mode
    mtd: fix M29W800D dev_id and uaddr
    mtd: don't use PF_MEMALLOC
    mtd: Add bad block table overrides to Davinci NAND driver
    ...

    Fixed up conflicts (mostly trivial) in
    drivers/mtd/devices/m25p80.c
    drivers/mtd/maps/pcmciamtd.c
    drivers/mtd/nand/pxa3xx_nand.c
    kernel/printk.c

    Linus Torvalds
     
  • do_sync_mapping_range(..., SYNC_FILE_RANGE_WRITE) is a very awkward way
    to perform a filemap_fdatawrite_range.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     
  • Currently the locking in blockdev_direct_IO is a mess, we have three different
    locking types and very confusing checks for some of them. The most
    complicated one is DIO_OWN_LOCKING for reads, which happens to not actually be
    used.

    This patch gets rid of the DIO_OWN_LOCKING - as mentioned above the read case
    is unused anyway, and the write side is almost identical to DIO_NO_LOCKING.
    The difference is that DIO_NO_LOCKING always sets the create argument for
    the get_blocks callback to zero, but we can easily move that to the actual
    get_blocks callbacks. There are four users of the DIO_NO_LOCKING mode:
    gfs already ignores the create argument and thus is fine with the new
    version, ocfs2 only errors out if create were ever set, and we can remove
    this dead code now, the block device code only ever uses create for an
    error message if we are fully beyond the device which can never happen,
    and last but not least XFS will need the new behavour for writes.

    Now we can replace the lock_type variable with a flags one, where no flag
    means the DIO_NO_LOCKING behaviour and DIO_LOCKING is kept as the first
    flag. Separate out the check for not allowing to fill holes into a separate
    flag, although for now both flags always get set at the same time.

    Also revamp the documentation of the locking scheme to actually make sense.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     
  • Now that we cache the ACL pointers in the generic inode all the generic_acl
    cruft can go away and generic_acl.c can directly implement xattr handlers
    dealing with the full Posix ACL semantics for in-memory filesystems.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     
  • Add a flags argument to struct xattr_handler and pass it to all xattr
    handler methods. This allows using the same methods for multiple
    handlers, e.g. for the ACL methods which perform exactly the same action
    for the access and default ACLs, just using a different underlying
    attribute. With a little more groundwork it'll also allow sharing the
    methods for the regular user/trusted/secure handlers in extN, ocfs2 and
    jffs2 like it's already done for xfs in this patch.

    Also change the inode argument to the handlers to a dentry to allow
    using the handlers mechnism for filesystems that require it later,
    e.g. cifs.

    [with GFS2 bits updated by Steven Whitehouse ]

    Signed-off-by: Christoph Hellwig
    Reviewed-by: James Morris
    Acked-by: Joel Becker
    Signed-off-by: Al Viro

    Christoph Hellwig
     
  • The EXPORT_SYMBOL for d_alloc_name is in fs/libfs.c but the function
    is in fs/dcache.c. Move the EXPORT_SYMBOL to the line immediately
    after the closing function brace line in fs/dcache.c as mentioned
    in Documentation/CodingStyle.

    Signed-off-by: H Hartley Sweeten
    Signed-off-by: Al Viro

    H Hartley Sweeten
     
  • procfs-style symlinks return a last_type of LAST_BIND without an actual
    path string. This causes __follow_link to skip calling __vfs_follow_link
    and so the dentry isn't revalidated.

    This is a problem when the link target sits on NFSv4 as it depends on
    the VFS to revalidate the dentry before using it on an open call. Ensure
    that this occurs by forcing a revalidation of the target dentry of
    LAST_BIND symlinks.

    Signed-off-by: Jeff Layton
    Acked-by: "Eric W. Biederman"
    Acked-by: Miklos Szeredi
    Signed-off-by: Al Viro

    Jeff Layton
     
  • Kill the 'update' argument of ima_path_check(), kill
    dead code in ima.

    Current rules: ima counters are bumped at the same time
    when the file switches from put_filp() fodder to fput()
    one. Which happens exactly in two places - alloc_file()
    and __dentry_open(). Nothing else needs to do that at
    all.

    Signed-off-by: Al Viro

    Al Viro
     
  • * do ima_get_count() in __dentry_open()
    * stop doing that in followups
    * move ima_path_check() to right after nameidata_to_filp()
    * don't bump counters on it

    Signed-off-by: Al Viro

    Al Viro
     
  • There are 2 groups of alloc_file() callers:
    * ones that are followed by ima_counts_get
    * ones giving non-regular files
    So let's pull that ima_counts_get() into alloc_file();
    it's a no-op in case of non-regular files.

    Signed-off-by: Al Viro

    Al Viro
     
  • * take truncate logics into a helper (handle_truncate())
    * rip it out of may_open()
    * call it from the only caller of may_open() that might pass
    O_TRUNC
    * and do that after we'd finished with opening.

    Signed-off-by: Al Viro

    Al Viro
     
  • All users outside of fs/ of get_empty_filp() have been removed. This patch
    moves the definition from the include/ directory to internal.h so no new
    users crop up and removes the EXPORT_SYMBOL. I'd love to see open intents
    stop using it too, but that's a problem for another day and a smarter
    developer!

    Signed-off-by: Eric Paris
    Acked-by: Miklos Szeredi
    Signed-off-by: Al Viro

    Eric Paris
     
  • Use the sucker in other places in pathname resolution
    that check MAY_EXEC for directories; lose the _lite
    from name, it's equivalent of full-blown inode_permission()
    for its callers (albeit still lighter, since large parts
    of generic_permission() do not apply for pure MAY_EXEC).

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Both callers of do_lookup() do the same thing before it

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • put retry logics into path_walk() and do_filp_open()

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • ... and have the caller grab both mnt and dentry; kill
    leak in infiniband, while we are at it.

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     

16 Dec, 2009

3 commits

  • Use hweight8 instead of counting for each bit

    Signed-off-by: Akinobu Mita
    Acked-by: Anders Larsen
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • commit 945ffe54bbd56ceed62de3b908800fd7c6ffb284 ("qnx4: remove write support") removed the (defunct)
    write support but missed a chunk of related, dead code.

    Signed-off-by: Anders Larsen
    Cc: Jiri Kosina
    Acked-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anders Larsen
     
  • Currently the locking in blockdev_direct_IO is a mess, we have three
    different locking types and very confusing checks for some of them. The
    most complicated one is DIO_OWN_LOCKING for reads, which happens to not
    actually be used.

    This patch gets rid of the DIO_OWN_LOCKING - as mentioned above the read
    case is unused anyway, and the write side is almost identical to
    DIO_NO_LOCKING. The difference is that DIO_NO_LOCKING always sets the
    create argument for the get_blocks callback to zero, but we can easily
    move that to the actual get_blocks callbacks. There are four users of the
    DIO_NO_LOCKING mode: gfs already ignores the create argument and thus is
    fine with the new version, ocfs2 only errors out if create were ever set,
    and we can remove this dead code now, the block device code only ever uses
    create for an error message if we are fully beyond the device which can
    never happen, and last but not least XFS will need the new behavour for
    writes.

    Now we can replace the lock_type variable with a flags one, where no flag
    means the DIO_NO_LOCKING behaviour and DIO_LOCKING is kept as the first
    flag. Separate out the check for not allowing to fill holes into a
    separate flag, although for now both flags always get set at the same
    time.

    Also revamp the documentation of the locking scheme to actually make
    sense.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Christoph Hellwig
    Cc: Dave Chinner
    Cc: Badari Pulavarty
    Cc: Jeff Moyer
    Cc: Jens Axboe
    Cc: Zach Brown
    Cc: Al Viro
    Cc: Alex Elder
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig