26 Oct, 2010

26 commits

  • Signed-off-by: Al Viro

    Al Viro
     
  • Make node look as if it was on hlist, with hlist_del()
    working correctly. Usable without any locking...

    Convert a couple of places where we want to do that to
    inode->i_hash.

    Signed-off-by: Al Viro

    Al Viro
     
  • note: for race-free uses you inode_lock held

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • We are in fill_super(); again, no inodes with zero i_count could
    be around until we set MS_ACTIVE.

    Signed-off-by: Al Viro

    Al Viro
     
  • In fill_super() we hadn't MS_ACTIVE set yet, so there won't
    be any inodes with zero i_count sitting around.

    In put_super() we already have MS_ACTIVE removed *and* we
    had called invalidate_inodes() since then. So again there
    won't be any inodes with zero i_count...

    Signed-off-by: Al Viro

    Al Viro
     
  • It's pointless - we *do* have busy inodes (root directory,
    for one), so that call will fail and attempt to change
    XIP flag will be ignored.

    Signed-off-by: Al Viro

    Al Viro
     
  • If we have the appropriate page already, call __block_write_begin()
    directly instead of releasing and regrabbing it inside of
    block_write_begin().

    Signed-off-by: Namhyung Kim
    Signed-off-by: Al Viro

    Namhyung Kim
     
  • Since inode->i_mode shares its bits for S_IFMT, S_ISDIR should be
    used to distinguish whether it is a dir or not.

    Signed-off-by: Namhyung Kim
    Signed-off-by: Al Viro

    Namhyung Kim
     
  • The aio batching code is using igrab to get an extra reference on the
    inode so it can safely batch. igrab will go ahead and take the global
    inode spinlock, which can be a bottleneck on large machines doing lots
    of AIO.

    In this case, igrab isn't required because we already have a reference
    on the file handle. It is safe to just bump the i_count directly
    on the inode.

    Benchmarking shows this patch brings IOP/s on tons of flash up by about
    2.5X.

    Signed-off-by: Chris Mason

    Chris Mason
     
  • bh->b_private is initialized within init_buffer(), thus the
    assignment should be redundant. Remove it.

    Signed-off-by: Namhyung Kim
    Signed-off-by: Al Viro

    Namhyung Kim
     
  • Move the EXPORTFS kconfig symbol out of the NETWORK_FILESYSTEMS block
    since it provides a library function that can be (and is) used by other
    (non-network) filesystems.

    This also eliminates a kconfig dependency warning:

    warning: (XFS_FS && BLOCK || NFSD && NETWORK_FILESYSTEMS && INET && FILE_LOCKING && BKL) selects EXPORTFS which has unmet direct dependencies (NETWORK_FILESYSTEMS)

    Signed-off-by: Randy Dunlap
    Cc: Dave Chinner
    Cc: Christoph Hellwig
    Cc: Alex Elder
    Cc: xfs-masters@oss.sgi.com
    Signed-off-by: Al Viro

    Randy Dunlap
     
  • Use sync_dirty_buffer instead of the incorrect opencoding it.

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

    Christoph Hellwig
     
  • Now, rw_verify_area() checsk f_pos is negative or not. And if negative,
    returns -EINVAL.

    But, some special files as /dev/(k)mem and /proc//mem etc.. has
    negative offsets. And we can't do any access via read/write to the
    file(device).

    So introduce FMODE_UNSIGNED_OFFSET to allow negative file offsets.

    Signed-off-by: Wu Fengguang
    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: Al Viro
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    KAMEZAWA Hiroyuki
     
  • 365b1818 ("add f_flags to struct statfs(64)") resized f_spare within
    struct statfs which caused a UML crash. There is no need to copy f_spare.

    Signed-off-by: Richard Weinberger
    Reported-by: Toralf Förster
    Tested-by: Toralf Förster
    Cc: Christoph Hellwig
    Cc: Al Viro
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Richard Weinberger
     
  • The intent was to verify that bh = affs_bread_ino(...) returned a valid
    pointer. We checked "ext_bh" earlier in the function and it's valid
    here.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Al Viro

    Dan Carpenter
     
  • Andrew,

    Could you please review this patch, you probably are the right guy to
    take it, because it crosses fs and net trees.

    Note : /proc/sys/fs/file-nr is a read-only file, so this patch doesnt
    depend on previous patch (sysctl: fix min/max handling in
    __do_proc_doulongvec_minmax())

    Thanks !

    [PATCH V4] fs: allow for more than 2^31 files

    Robin Holt tried to boot a 16TB system and found af_unix was overflowing
    a 32bit value :

    We were seeing a failure which prevented boot. The kernel was incapable
    of creating either a named pipe or unix domain socket. This comes down
    to a common kernel function called unix_create1() which does:

    atomic_inc(&unix_nr_socks);
    if (atomic_read(&unix_nr_socks) > 2 * get_max_files())
    goto out;

    The function get_max_files() is a simple return of files_stat.max_files.
    files_stat.max_files is a signed integer and is computed in
    fs/file_table.c's files_init().

    n = (mempages * (PAGE_SIZE / 1024)) / 10;
    files_stat.max_files = n;

    In our case, mempages (total_ram_pages) is approx 3,758,096,384
    (0xe0000000). That leaves max_files at approximately 1,503,238,553.
    This causes 2 * get_max_files() to integer overflow.

    Fix is to let /proc/sys/fs/file-nr & /proc/sys/fs/file-max use long
    integers, and change af_unix to use an atomic_long_t instead of
    atomic_t.

    get_max_files() is changed to return an unsigned long.
    get_nr_files() is changed to return a long.

    unix_nr_socks is changed from atomic_t to atomic_long_t, while not
    strictly needed to address Robin problem.

    Before patch (on a 64bit kernel) :
    # echo 2147483648 >/proc/sys/fs/file-max
    # cat /proc/sys/fs/file-max
    -18446744071562067968

    After patch:
    # echo 2147483648 >/proc/sys/fs/file-max
    # cat /proc/sys/fs/file-max
    2147483648
    # cat /proc/sys/fs/file-nr
    704 0 2147483648

    Reported-by: Robin Holt
    Signed-off-by: Eric Dumazet
    Acked-by: David Miller
    Reviewed-by: Robin Holt
    Tested-by: Robin Holt
    Signed-off-by: Al Viro

    Eric Dumazet
     
  • Currently isofs_get_blocks() was limited to handle only 4TB files on 32-bit
    architectures because of unnecessary use of iblock variable which was signed
    long. Just remove the variable. The error messages that were using this
    variable should have rather used b_off anyway because that is the block we
    are currently mapping.

    Signed-off-by: Jan Kara
    Signed-off-by: Al Viro

    Jan Kara
     
  • __block_write_begin and block_prepare_write are identical except for slightly
    different calling conventions. Convert all callers to the __block_write_begin
    calling conventions and drop block_prepare_write.

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

    Christoph Hellwig
     
  • Hugetlbfs used to need it, but after the destroy_inode and evict_inode
    changes it's not required anymore.

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

    Christoph Hellwig
     
  • Add a new helper to write out the inode using the writeback code,
    that is including the correct dirty bit and list manipulation. A few
    of filesystems already opencode this, and a lot of others should be
    using it instead of using write_inode_now which also writes out the
    data.

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

    Christoph Hellwig
     
  • The caller that didn't need it is gone.

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

    Christoph Hellwig
     
  • * 'for-linus' of git://git.open-osd.org/linux-open-osd:
    exofs: Remove inode->i_count manipulation in exofs_new_inode
    fs/exofs: typo fix of faild to failed
    exofs: Set i_mapping->backing_dev_info anyway
    exofs: Cleaup read path in regard with read_for_write

    Linus Torvalds
     
  • exofs_new_inode() was incrementing the inode->i_count and
    decrementing it in create_done(), in a bad attempt to make sure
    the inode will still be there when the asynchronous create_done()
    finally arrives. This was very stupid because iput() was not called,
    and if it was actually needed, it would leak the inode.

    However all this is not needed, because at exofs_evict_inode()
    we already wait for create_done() by waiting for the
    object_created event. Therefore remove the superfluous ref counting
    and just Thicken the comment at exofs_evict_inode() a bit.

    While at it change places that open coded wait_obj_created()
    to call the already available wrapper.

    CC: Dave Chinner
    CC: Christoph Hellwig
    CC: Nick Piggin
    Signed-off-by: Boaz Harrosh

    Boaz Harrosh
     
  • Signed-off-by: Joe Perches
    Signed-off-by: Boaz Harrosh

    Joe Perches
     

25 Oct, 2010

6 commits

  • Replace the BKL with a mutex to protect the venus_comm structure which
    binds the mountpoint with the character device and holds the upcall
    queues.

    Signed-off-by: Yoshihisa Abe
    Signed-off-by: Jan Harkes
    Signed-off-by: Linus Torvalds

    Yoshihisa Abe
     
  • Now that shared inode state is locked using the cii->c_lock, the BKL is
    only used to protect the upcall queues used to communicate with the
    userspace cache manager. The remaining state is all local and we can
    push the lock further down into coda_upcall().

    Signed-off-by: Yoshihisa Abe
    Signed-off-by: Jan Harkes
    Signed-off-by: Linus Torvalds

    Yoshihisa Abe
     
  • We mostly need it to protect cached user permissions. The c_flags field
    is advisory, reading the wrong value is harmless and in the worst case
    we hit a slow path where we have to make an extra upcall to the
    userspace cache manager when revalidating a dentry or inode.

    Signed-off-by: Yoshihisa Abe
    Signed-off-by: Jan Harkes
    Signed-off-by: Linus Torvalds

    Yoshihisa Abe
     
  • * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
    Revert "block: fix accounting bug on cross partition merges"

    Linus Torvalds
     
  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    Update broken web addresses in arch directory.
    Update broken web addresses in the kernel.
    Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget
    Revert "Fix typo: configuation => configuration" partially
    ida: document IDA_BITMAP_LONGS calculation
    ext2: fix a typo on comment in ext2/inode.c
    drivers/scsi: Remove unnecessary casts of private_data
    drivers/s390: Remove unnecessary casts of private_data
    net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data
    drivers/infiniband: Remove unnecessary casts of private_data
    drivers/gpu/drm: Remove unnecessary casts of private_data
    kernel/pm_qos_params.c: Remove unnecessary casts of private_data
    fs/ecryptfs: Remove unnecessary casts of private_data
    fs/seq_file.c: Remove unnecessary casts of private_data
    arm: uengine.c: remove C99 comments
    arm: scoop.c: remove C99 comments
    Fix typo configue => configure in comments
    Fix typo: configuation => configuration
    Fix typo interrest[ing|ed] => interest[ing|ed]
    Fix various typos of valid in comments
    ...

    Fix up trivial conflicts in:
    drivers/char/ipmi/ipmi_si_intf.c
    drivers/usb/gadget/rndis.c
    net/irda/irnet/irnet_ppp.c

    Linus Torvalds
     
  • This reverts commit 7681bfeeccff5efa9eb29bf09249a3c400b15327.

    Conflicts:

    include/linux/genhd.h

    It has numerous issues with the cleanup path and non-elevator
    devices. Revert it for now so we can come up with a clean
    version without rushing things.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

23 Oct, 2010

8 commits

  • This reverts commit f4a3e0bceb57466c31757f25e4e0ed108d1299ec. Jiri
    Sladby points out that the tty structure we're using may already be
    gone, and Al Viro doesn't hold back in complaining about the random
    loading of 'filp->private_data' which doesn't have to be a pointer at
    all, nor does checking the magic field for TTY_MAGIC prove anything.

    Belated review by Al:

    "a) global variable depending on stdin of the last opener? Affecting
    output of read(2)? Really?

    b) iterator is broken; list should be locked in ->start(), unlocked in
    ->stop() and *NOT* unlocked/relocked in ->next()

    c) ->show() ought to do nothing in case of ->device == NULL, instead
    of skipping those in ->next()/->start()

    d) regardless of the merits of the bright idea about asterisk at that
    line in output *and* regardless of (a), the implementation is not
    only atrociously ugly, it's actually very likely to be a roothole.
    Verifying that Cthulhu knows what number happens to be address of a
    tty_struct by blindly dereferencing memory at that address...
    Ouch.

    Please revert that crap."

    And Christoph pipes in and NAK's the approach of walking fd tables etc
    too. So it's pretty unanimous.

    Noticed-by: Jri Slaby
    Requested-by: Al Viro
    Cc: Greg Kroah-Hartman
    Cc: Werner Fink
    Cc: Alan Cox
    Cc: Christoph Hellwig
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2: (36 commits)
    nilfs2: eliminate sparse warning - "context imbalance"
    nilfs2: eliminate sparse warnings - "symbol not declared"
    nilfs2: get rid of bdi from nilfs object
    nilfs2: change license of exported header file
    nilfs2: add bdev freeze/thaw support
    nilfs2: accept 64-bit checkpoint numbers in cp mount option
    nilfs2: remove own inode allocator and destructor for metadata files
    nilfs2: get rid of back pointer to writable sb instance
    nilfs2: get rid of mi_nilfs back pointer to nilfs object
    nilfs2: see state of root dentry for mount check of snapshots
    nilfs2: use iget for all metadata files
    nilfs2: get rid of GCDAT inode
    nilfs2: add routines to redirect access to buffers of DAT file
    nilfs2: add routines to roll back state of DAT file
    nilfs2: add routines to save and restore bmap state
    nilfs2: do not allocate nilfs_mdt_info structure to gc-inodes
    nilfs2: allow nilfs_clear_inode to clear metadata file inodes
    nilfs2: get rid of snapshot mount flag
    nilfs2: simplify life cycle management of nilfs object
    nilfs2: do not allocate multiple super block instances for a device
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (49 commits)
    serial8250: ratelimit "too much work" error
    serial: bfin_sport_uart: speed up sport RX sample rate to be 3% faster
    serial: abstraction for 8250 legacy ports
    serial/imx: check that the buffer is non-empty before sending it out
    serial: mfd: add more baud rates support
    jsm: Remove the uart port on errors
    Alchemy: Add UART PM methods.
    8250: allow platforms to override PM hook.
    altera_uart: Don't use plain integer as NULL pointer
    altera_uart: Fix missing prototype for registering an early console
    altera_uart: Fixup type usage of port flags
    altera_uart: Make it possible to use Altera UART and 8250 ports together
    altera_uart: Add support for different address strides
    altera_uart: Add support for getting mapbase and IRQ from resources
    altera_uart: Add support for polling mode (IRQ-less)
    serial: Factor out uart_poll_timeout() from 8250 driver
    serial: mark the 8250 driver as maintained
    serial: 8250: Don't delay after transmitter is ready.
    tty: MAINTAINERS: add drivers/serial/jsm/ as maintained driver
    vcs: invoke the vt update callback when /dev/vcs* is written to
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (31 commits)
    driver core: Display error codes when class suspend fails
    Driver core: Add section count to memory_block struct
    Driver core: Add mutex for adding/removing memory blocks
    Driver core: Move find_memory_block routine
    hpilo: Despecificate driver from iLO generation
    driver core: Convert link_mem_sections to use find_memory_block_hinted.
    driver core: Introduce find_memory_block_hinted which utilizes kset_find_obj_hinted.
    kobject: Introduce kset_find_obj_hinted.
    driver core: fix build for CONFIG_BLOCK not enabled
    driver-core: base: change to new flag variable
    sysfs: only access bin file vm_ops with the active lock
    sysfs: Fail bin file mmap if vma close is implemented.
    FW_LOADER: fix kconfig dependency warning on HOTPLUG
    uio: Statically allocate uio_class and use class .dev_attrs.
    uio: Support 2^MINOR_BITS minors
    uio: Cleanup irq handling.
    uio: Don't clear driver data
    uio: Fix lack of locking in init_uio_class
    SYSFS: Allow boot time switching between deprecated and modern sysfs layout
    driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices
    ...

    Linus Torvalds
     
  • Commit dd3932eddf42 ("block: remove BLKDEV_IFL_WAIT") had removed the
    flag argument to blkdev_issue_flush(), but the ocfs2 merge brought in a
    new one. It didn't cause a merge conflict, so the merges silently
    worked out fine, but the result didn't actually compile.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (56 commits)
    [CIFS] move close processing from cifs_close to cifsFileInfo_put
    cifs: convert cifs_tcp_ses_lock from a rwlock to a spinlock
    cifs: cancel_delayed_work() + flush_scheduled_work() -> cancel_delayed_work_sync()
    Clean up two declarations of blob_len
    cifs: move cifsFileInfo_put to file.c
    cifs: convert GlobalSMBSeslock from a rwlock to regular spinlock
    [CIFS] Fix minor checkpatch warning and update cifs version
    cifs: move cifs_new_fileinfo to file.c
    cifs: eliminate pfile pointer from cifsFileInfo
    cifs: cifs_write argument change and cleanup
    cifs: clean up cifs_reopen_file
    cifs: eliminate the inode argument from cifs_new_fileinfo
    cifs: eliminate oflags option from cifs_new_fileinfo
    cifs: fix flags handling in cifs_posix_open
    cifs: eliminate cifs_posix_open_inode_helper
    cifs: handle FindFirst failure gracefully
    NTLM authentication and signing - Calculate auth response per smb session
    cifs: don't use vfsmount to pin superblock for oplock breaks
    cifs: keep dentry reference in cifsFileInfo instead of inode reference
    cifs: on multiuser mount, set ownership to current_fsuid/current_fsgid (try #7)
    ...

    Fix up trivial conflict in fs/cifs/cifsfs.c due to added/removed header files

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
    dlm: Fix dlm lock status block comment in dlm.h
    dlm: Don't send callback to node making lock request when "try 1cb" fails

    Linus Torvalds
     
  • * 'for-linus' of git://oss.sgi.com/xfs/xfs: (36 commits)
    xfs: semaphore cleanup
    xfs: Extend project quotas to support 32bit project ids
    xfs: remove xfs_buf wrappers
    xfs: remove xfs_cred.h
    xfs: remove xfs_globals.h
    xfs: remove xfs_version.h
    xfs: remove xfs_refcache.h
    xfs: fix the xfs_trans_committed
    xfs: remove unused t_callback field in struct xfs_trans
    xfs: fix bogus m_maxagi check in xfs_iget
    xfs: do not use xfs_mod_incore_sb_batch for per-cpu counters
    xfs: do not use xfs_mod_incore_sb for per-cpu counters
    xfs: remove XFS_MOUNT_NO_PERCPU_SB
    xfs: pack xfs_buf structure more tightly
    xfs: convert buffer cache hash to rbtree
    xfs: serialise inode reclaim within an AG
    xfs: batch inode reclaim lookup
    xfs: implement batched inode lookups for AG walking
    xfs: split out inode walk inode grabbing
    xfs: split inode AG walking into separate code for reclaim
    ...

    Linus Torvalds