04 Jan, 2012

2 commits

  • vfs_create() ignores everything outside of 16bit subset of its
    mode argument; switching it to umode_t is obviously equivalent
    and it's the only caller of the method

    Signed-off-by: Al Viro

    Al Viro
     
  • Seeing that just about every destructor got that INIT_LIST_HEAD() copied into
    it, there is no point whatsoever keeping this INIT_LIST_HEAD in inode_init_once();
    the cost of taking it into inode_init_always() will be negligible for pipes
    and sockets and negative for everything else. Not to mention the removal of
    boilerplate code from ->destroy_inode() instances...

    Signed-off-by: Al Viro

    Al Viro
     

02 Nov, 2011

1 commit


28 May, 2011

1 commit


26 May, 2011

1 commit


25 Mar, 2011

1 commit

  • * 'for-2.6.39/core' of git://git.kernel.dk/linux-2.6-block: (65 commits)
    Documentation/iostats.txt: bit-size reference etc.
    cfq-iosched: removing unnecessary think time checking
    cfq-iosched: Don't clear queue stats when preempt.
    blk-throttle: Reset group slice when limits are changed
    blk-cgroup: Only give unaccounted_time under debug
    cfq-iosched: Don't set active queue in preempt
    block: fix non-atomic access to genhd inflight structures
    block: attempt to merge with existing requests on plug flush
    block: NULL dereference on error path in __blkdev_get()
    cfq-iosched: Don't update group weights when on service tree
    fs: assign sb->s_bdi to default_backing_dev_info if the bdi is going away
    block: Require subsystems to explicitly allocate bio_set integrity mempool
    jbd2: finish conversion from WRITE_SYNC_PLUG to WRITE_SYNC and explicit plugging
    jbd: finish conversion from WRITE_SYNC_PLUG to WRITE_SYNC and explicit plugging
    fs: make fsync_buffers_list() plug
    mm: make generic_writepages() use plugging
    blk-cgroup: Add unaccounted time to timeslice_used.
    block: fixup plugging stubs for !CONFIG_BLOCK
    block: remove obsolete comments for blkdev_issue_zeroout.
    blktrace: Use rq->cmd_flags directly in blk_add_trace_rq.
    ...

    Fix up conflicts in fs/{aio.c,super.c}

    Linus Torvalds
     

21 Mar, 2011

1 commit

  • The usage of find_first_zero_bit() in bfs_create() is wrong for two
    reasons.

    The bitmap size argument to find_first_zero_bit() is info->si_lasti but
    the correct bitmap size is info->si_lasti + 1 as info->si_lasti is the
    last valid index in info->si_imap bitmap.

    Another problem is that it is impossible to detect that info->si_imap
    bitmap is full because there is an off-by-one bug in the return value
    check for find_first_zero_bit(). If no zero bits exist in info->si_imap,
    find_first_zero_bit() returns info->si_lasti. But the check can't catch
    it due to the off-by-one.

    Signed-off-by: Akinobu Mita
    Acked-by: "Tigran A. Aivazian"
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Akinobu Mita
     

10 Mar, 2011

1 commit

  • Code has been converted over to the new explicit on-stack plugging,
    and delay users have been converted to use the new API for that.
    So lets kill off the old plugging along with aops->sync_page().

    Signed-off-by: Jens Axboe

    Jens Axboe
     

07 Jan, 2011

1 commit

  • RCU free the struct inode. This will allow:

    - Subsequent store-free path walking patch. The inode must be consulted for
    permissions when walking, so an RCU inode reference is a must.
    - sb_inode_list_lock to be moved inside i_lock because sb list walkers who want
    to take i_lock no longer need to take sb_inode_list_lock to walk the list in
    the first place. This will simplify and optimize locking.
    - Could remove some nested trylock loops in dcache code
    - Could potentially simplify things a bit in VM land. Do not need to take the
    page lock to follow page->mapping.

    The downsides of this is the performance cost of using RCU. In a simple
    creat/unlink microbenchmark, performance drops by about 10% due to inability to
    reuse cache-hot slab objects. As iterations increase and RCU freeing starts
    kicking over, this increases to about 20%.

    In cases where inode lifetimes are longer (ie. many inodes may be allocated
    during the average life span of a single inode), a lot of this cache reuse is
    not applicable, so the regression caused by this patch is smaller.

    The cache-hot regression could largely be avoided by using SLAB_DESTROY_BY_RCU,
    however this adds some complexity to list walking and store-free path walking,
    so I prefer to implement this at a later date, if it is shown to be a win in
    real situations. I haven't found a regression in any non-micro benchmark so I
    doubt it will be a problem.

    Signed-off-by: Nick Piggin

    Nick Piggin
     

29 Oct, 2010

1 commit


26 Oct, 2010

1 commit


05 Oct, 2010

2 commits

  • The BKL is only used in put_super and fill_super that are both protected by
    the superblocks s_umount rw_semaphore. Therefore it is safe to remove the BKL
    entirely.

    Signed-off-by: Jan Blunck
    Signed-off-by: Arnd Bergmann

    Jan Blunck
     
  • This patch is a preparation necessary to remove the BKL from do_new_mount().
    It explicitly adds calls to lock_kernel()/unlock_kernel() around
    get_sb/fill_super operations for filesystems that still uses the BKL.

    I've read through all the code formerly covered by the BKL inside
    do_kern_mount() and have satisfied myself that it doesn't need the BKL
    any more.

    do_kern_mount() is already called without the BKL when mounting the rootfs
    and in nfsctl. do_kern_mount() calls vfs_kern_mount(), which is called
    from various places without BKL: simple_pin_fs(), nfs_do_clone_mount()
    through nfs_follow_mountpoint(), afs_mntpt_do_automount() through
    afs_mntpt_follow_link(). Both later functions are actually the filesystems
    follow_link inode operation. vfs_kern_mount() is calling the specified
    get_sb function and lets the filesystem do its job by calling the given
    fill_super function.

    Therefore I think it is safe to push down the BKL from the VFS to the
    low-level filesystems get_sb/fill_super operation.

    [arnd: do not add the BKL to those file systems that already
    don't use it elsewhere]

    Signed-off-by: Jan Blunck
    Signed-off-by: Arnd Bergmann
    Cc: Matthew Wilcox
    Cc: Christoph Hellwig

    Jan Blunck
     

10 Aug, 2010

3 commits

  • BFS is a very simple FS and its superblocks contains only static
    information and is never changed. However, the BFS code for some
    misterious reasons marked its buffer head as dirty from time to
    time, but nothing in that buffer was ever changed.

    This patch removes all the BFS superblock manipulation, simply
    because it is not needed. It removes:

    1. The si_sbh filed from 'struct bfs_sb_info' because it is not
    needed. We only need to read the SB once on mount to get the
    start of data blocks and the FS size. After this, we can forget
    about the SB.
    2. All instances of 'mark_buffer_dirty(sbh)' for BFS SB because
    it is never changed.
    3. The '->sync_fs()' method because there is nothing to sync
    (inodes are synched by VFS).
    4. The '->write_super()' method, again, because the SB is never
    changed.

    Tested-by: Artem Bityutskiy
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: Al Viro

    Artem Bityutskiy
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Move the call to vmtruncate to get rid of accessive blocks to the callers
    in preparation of the new truncate sequence and rename the non-truncating
    version to block_write_begin.

    While we're at it also remove several unused arguments to block_write_begin.

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

    Christoph Hellwig
     

28 May, 2010

1 commit

  • We don't name our generic fsync implementations very well currently.
    The no-op implementation for in-memory filesystems currently is called
    simple_sync_file which doesn't make too much sense to start with,
    the the generic one for simple filesystems is called simple_fsync
    which can lead to some confusion.

    This patch renames the generic file fsync method to generic_file_fsync
    to match the other generic_file_* routines it is supposed to be used
    with, and the no-op implementation to noop_fsync to make it obvious
    what to expect. In addition add some documentation for both methods.

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

    Christoph Hellwig
     

22 May, 2010

1 commit


06 Mar, 2010

1 commit

  • This gives the filesystem more information about the writeback that
    is happening. Trond requested this for the NFS unstable write handling,
    and other filesystems might benefit from this too by beeing able to
    distinguish between the different callers in more detail.

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

    Christoph Hellwig
     

27 Jan, 2010

1 commit


13 Jul, 2009

1 commit

  • * Remove smp_lock.h from files which don't need it (including some headers!)
    * Add smp_lock.h to files which do need it
    * Make smp_lock.h include conditional in hardirq.h
    It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

    This will make hardirq.h inclusion cheaper for every PREEMPT=n config
    (which includes allmodconfig/allyesconfig, BTW)

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

12 Jun, 2009

4 commits

  • Add a ->sync_fs method for data integrity syncs, and reimplement
    ->write_super ontop of it.

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

    Christoph Hellwig
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Move BKL into ->put_super from the only caller. A couple of
    filesystems had trivial enough ->put_super (only kfree and NULLing of
    s_fs_info + stuff in there) to not get any locking: coda, cramfs, efs,
    hugetlbfs, omfs, qnx4, shmem, all others got the full treatment. Most
    of them probably don't need it, but I'd rather sort that out individually.
    Preferably after all the other BKL pushdowns in that area.

    [AV: original used to move lock_super() down as well; these changes are
    removed since we don't do lock_super() at all in generic_shutdown_super()
    now]
    [AV: fuse, btrfs and xfs are known to need no damn BKL, exempt]

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

    Christoph Hellwig
     
  • We just did a full fs writeout using sync_filesystem before, and if
    that's not enough for the filesystem it can perform it's own writeout
    in ->put_super, which many filesystems already do.

    Move a call to foofs_write_super into every foofs_put_super for now to
    guarantee identical behaviour until it's cleaned up by the individual
    filesystem maintainers.

    Exceptions:

    - affs already has identical copy & pasted code at the beginning of
    affs_put_super so no need to do it twice.
    - xfs does the right thing without it and I have changes pending for
    the xfs tree touching this are so I don't really need conflicts
    here..

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

    Christoph Hellwig
     

22 Jan, 2009

1 commit


07 Jan, 2009

2 commits

  • Since all sanity checks rely on the validity of s_start which gets only
    checked to be smaller than s_end, we should also check if s_end is sane.
    Now we also try to retrieve the last block of the filesystem, which is
    computed by s_end. If this fails, something is bogus.

    Signed-off-by: Eric Sesterhenn
    Acked-by: Tigran Aivazian

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sesterhenn
     
  • bfs_fill_super() already touches all inodes, so we can easily add some
    cheap sanity checks and check if the inode start and end blocks are
    smaller than the maximum number of blocks, the inode start block lies
    behind the end block or the file end offset is behind the end of the
    filesystem. Also check if the start of data offset in the super block
    fits the filesystem.

    The added sanity checks catch softlockup issues early when we try to
    sb_bread() lots of blocks in a loop in bfs_readdir() and bfs_find_entry().
    In addition an oom issue in bfs_fill_super() is prevented by this when
    s_start is corrupted, which influences imap_len and we try to allocate a
    huge info->si_imap.

    Signed-off-by: Eric Sesterhenn
    Acked-by: Tigran Aivazian

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sesterhenn
     

14 Nov, 2008

1 commit

  • Wrap access to task credentials so that they can be separated more easily from
    the task_struct during the introduction of COW creds.

    Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().

    Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more
    sense to use RCU directly rather than a convenient wrapper; these will be
    addressed by later patches.

    Signed-off-by: David Howells
    Reviewed-by: James Morris
    Acked-by: Serge Hallyn
    Cc: Tigran A. Aivazian
    Signed-off-by: James Morris

    David Howells
     

23 Oct, 2008

1 commit


14 Sep, 2008

1 commit

  • This fixes:

    =============================================
    [ INFO: possible recursive locking detected ]
    2.6.27-rc5-00283-g70bb089 #68
    ---------------------------------------------
    touch/6855 is trying to acquire lock:
    (&info->bfs_lock){--..}, at: [] bfs_delete_inode+0x9e/0x18c

    but task is already holding lock:
    (&info->bfs_lock){--..}, at: [] bfs_create+0x45/0x187

    other info that might help us debug this:
    2 locks held by touch/6855:
    #0: (&type->i_mutex_dir_key#5){--..}, at: [] do_filp_open+0x10b/0x62f
    #1: (&info->bfs_lock){--..}, at: [] bfs_create+0x45/0x187

    stack backtrace:
    Pid: 6855, comm: touch Not tainted 2.6.27-rc5-00283-g70bb089 #68
    [] validate_chain+0x458/0x9f4
    [] ? trace_hardirqs_off+0xb/0xd
    [] __lock_acquire+0x666/0x6e0
    [] lock_acquire+0x5b/0x77
    [] ? bfs_delete_inode+0x9e/0x18c
    [] mutex_lock_nested+0xbc/0x234
    [] ? bfs_delete_inode+0x9e/0x18c
    [] ? bfs_delete_inode+0x9e/0x18c
    [] bfs_delete_inode+0x9e/0x18c
    [] ? bfs_delete_inode+0x0/0x18c
    [] generic_delete_inode+0x94/0xfe
    [] generic_drop_inode+0x12/0x12f
    [] iput+0x4b/0x4e
    [] bfs_create+0x163/0x187
    [] vfs_create+0xa6/0x114
    [] do_filp_open+0x1ad/0x62f
    [] ? native_sched_clock+0x82/0x96
    [] ? _spin_unlock+0x27/0x3c
    [] ? alloc_fd+0xbf/0xc9
    [] ? sub_preempt_count+0x9d/0xab
    [] ? alloc_fd+0xbf/0xc9
    [] do_sys_open+0x42/0xb8
    [] ? trace_hardirqs_on_thunk+0xc/0x10
    [] sys_open+0x1e/0x26
    [] sysenter_do_call+0x12/0x31
    =======================

    The problem is that we don't unlock the bfs->lock mutex before calling
    iput (we do in the other cases).

    Signed-off-by: Eric Sesterhenn
    Cc: Tigran Aivazian
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sesterhenn
     

27 Jul, 2008

3 commits

  • Kmem cache passed to constructor is only needed for constructors that are
    themselves multiplexeres. Nobody uses this "feature", nor does anybody uses
    passed kmem cache in non-trivial way, so pass only pointer to object.

    Non-trivial places are:
    arch/powerpc/mm/init_64.c
    arch/powerpc/mm/hugetlbpage.c

    This is flag day, yes.

    Signed-off-by: Alexey Dobriyan
    Acked-by: Pekka Enberg
    Acked-by: Christoph Lameter
    Cc: Jon Tollefson
    Cc: Nick Piggin
    Cc: Matt Mackall
    [akpm@linux-foundation.org: fix arch/powerpc/mm/hugetlbpage.c]
    [akpm@linux-foundation.org: fix mm/slab.c]
    [akpm@linux-foundation.org: fix ubifs]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Replace the BKL-based locking scheme used in the bfs driver by a private
    filesystem-wide mutex.

    Signed-off-by: Dmitri Vorobiev
    Cc: Tigran Aivazian
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitri Vorobiev
     
  • This patch makes the following cleanups:

    o removing an unused variable from bfs_fill_super();
    o removing unneeded blank spaces from pointer
    definitions.

    Signed-off-by: Dmitri Vorobiev
    Cc: Tigran Aivazian
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitri Vorobiev
     

30 Apr, 2008

1 commit


08 Feb, 2008

1 commit

  • Stop the BFS filesystem from using iget() and read_inode(). Replace
    bfs_read_inode() with bfs_iget(), and call that instead of iget(). bfs_iget()
    then uses iget_locked() directly and returns a proper error code instead of an
    inode in the event of an error.

    bfs_fill_super() returns any error incurred when getting the root inode
    instead of EINVAL.

    [kamalesh@linux.vnet.ibm.com: build fix]
    Signed-off-by: David Howells
    Acked-by: Christoph Hellwig
    Signed-off-by: Kamalesh Babulal
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

06 Dec, 2007

1 commit

  • BFS_FILEBLOCKS() expects struct bfs_inode * (on-disk data, with little-
    endian fields), not struct bfs_inode_info * (in-core stuff, with host-
    endian ones).

    It's a macro and fields with the right names are present in
    bfs_inode_info, so it compiles, but on big-endian host it gives bogus
    results.

    Introduced in commit f433dc56344cb72cc3de5ba0819021cec3aef807 ("Fixes to
    the BFS filesystem driver").

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

    Al Viro
     

15 Nov, 2007

1 commit

  • I found a few bugs in the BFS driver. Detailed description of the bugs as
    well as the steps to reproduce the errors are given in the kernel bugzilla.
    Please follow these links for more information:

    http://bugzilla.kernel.org/show_bug.cgi?id=9363
    http://bugzilla.kernel.org/show_bug.cgi?id=9364
    http://bugzilla.kernel.org/show_bug.cgi?id=9365
    http://bugzilla.kernel.org/show_bug.cgi?id=9366

    This patch fixes the bugs described above. Besides, the patch introduces
    coding style changes to make the BFS driver conform to the requirements
    specified for Linux kernel code. Finally, I made a few cosmetic changes
    such as removal of trivial debug output.

    Also, the patch removes the fields `si_lf_ioff' and `si_lf_sblk' of the
    in-core superblock structure. These fields are initialized but never
    actually used.

    If you are wondering why I need BFS, here is the answer: I am using this
    driver in the context of Linux kernel classes I am teaching in the Moscow
    State University and in the International Institute of Information
    Technology in Pune, India.

    Signed-off-by: Dmitri Vorobiev
    Cc: Tigran Aivazian
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitri Vorobiev
     

17 Oct, 2007

2 commits

  • Slab constructors currently have a flags parameter that is never used. And
    the order of the arguments is opposite to other slab functions. The object
    pointer is placed before the kmem_cache pointer.

    Convert

    ctor(void *object, struct kmem_cache *s, unsigned long flags)

    to

    ctor(struct kmem_cache *s, void *object)

    throughout the kernel

    [akpm@linux-foundation.org: coupla fixes]
    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • Signed-off-by: Nick Piggin
    Cc: Tigran Aivazian
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin