10 Jan, 2012

1 commit

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    ext2/3/4: delete unneeded includes of module.h
    ext{3,4}: Fix potential race when setversion ioctl updates inode
    udf: Mark LVID buffer as uptodate before marking it dirty
    ext3: Don't warn from writepage when readonly inode is spotted after error
    jbd: Remove j_barrier mutex
    reiserfs: Force inode evictions before umount to avoid crash
    reiserfs: Fix quota mount option parsing
    udf: Treat symlink component of type 2 as /
    udf: Fix deadlock when converting file from in-ICB one to normal one
    udf: Cleanup calling convention of inode_getblk()
    ext2: Fix error handling on inode bitmap corruption
    ext3: Fix error handling on inode bitmap corruption
    ext3: replace ll_rw_block with other functions
    ext3: NULL dereference in ext3_evict_inode()
    jbd: clear revoked flag on buffers before a new transaction started
    ext3: call ext3_mark_recovery_complete() when recovery is really needed

    Linus Torvalds
     

09 Jan, 2012

1 commit

  • Delete any instances of include module.h that were not strictly
    required. In the case of ext2, the declaration of MODULE_LICENSE
    etc. were in inode.c but the module_init/exit were in super.c, so
    relocate the MODULE_LICENCE/AUTHOR block to super.c which makes it
    consistent with ext3 and ext4 at the same time.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: Jan Kara

    Paul Gortmaker
     

07 Jan, 2012

1 commit


04 Jan, 2012

1 commit

  • 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
     

30 Aug, 2011

1 commit


17 May, 2011

1 commit

  • When ext2 mounts a filesystem, it attempts to set the block device
    blocksize with a call to sb_set_blocksize, which can fail for
    several reasons. The current failure message in ext2 prints:

    EXT2-fs (loop1): error: blocksize is too small

    which is not correct in all cases. This can be demonstrated
    by creating a filesystem with

    # mkfs.ext2 -b 8192

    on a 4k page system, and attempting to mount it.

    Change the error message to a more generic:

    EXT2-fs (loop1): bad blocksize 8192

    to match the error message in ext3.

    Signed-off-by: Robin Dong
    Reviewed-by: Coly Li
    Reviewed-by: Eric Sandeen
    Signed-off-by: Jan Kara

    Robin Dong
     

31 Mar, 2011

1 commit


12 Jan, 2011

1 commit

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
    ext2: Resolve 'dereferencing pointer to incomplete type' when enabling EXT2_XATTR_DEBUG
    ext3: Remove redundant unlikely()
    ext2: Remove redundant unlikely()
    ext3: speed up file creates by optimizing rec_len functions
    ext2: speed up file creates by optimizing rec_len functions
    ext3: Add more journal error check
    ext3: Add journal error check in resize.c
    quota: Use %pV and __attribute__((format (printf in __quota_error and fix fallout
    ext3: Add FITRIM handling
    ext3: Add batched discard support for ext3
    ext3: Add journal error check into ext3_rename()
    ext3: Use search_dirblock() in ext3_dx_find_entry()
    ext3: Avoid uninitialized memory references with a corrupted htree directory
    ext3: Return error code from generic_check_addressable
    ext3: Add journal error check into ext3_delete_entry()
    ext3: Add error check in ext3_mkdir()
    fs/ext3/super.c: Use printf extension %pV
    fs/ext2/super.c: Use printf extension %pV
    ext3: don't update sb journal_devnum when RO dev

    Linus Torvalds
     

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
     

06 Jan, 2011

1 commit


29 Oct, 2010

1 commit


26 Oct, 2010

1 commit


05 Oct, 2010

2 commits

  • The BKL is still used in ext2_put_super(), ext2_fill_super(), ext2_sync_fs()
    ext2_remount() and ext2_write_inode(). From these calls ext2_put_super(),
    ext2_fill_super() and ext2_remount() are protected against each other by
    the struct super_block s_umount rw semaphore. The call in ext2_write_inode()
    could only protect the modification of the ext2_sb_info through
    ext2_update_dynamic_rev() against concurrent ext2_sync_fs() or ext2_remount().
    ext2_fill_super() and ext2_put_super() can be left out because you need a
    valid filesystem reference in all three cases, which you do not have when
    you are one of these functions.

    If the BKL is only protecting the modification of the ext2_sb_info it can
    safely be removed since this is protected by the struct ext2_sb_info s_lock.

    Signed-off-by: Jan Blunck
    Cc: Jan Kara
    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

1 commit


24 May, 2010

5 commits

  • Follow the dquot_* style used elsewhere in dquot.c.

    [Jan Kara: Fixed up missing conversion of ext2]

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Christoph Hellwig
     
  • Only set the quota operation vectors if the filesystem actually supports
    quota instead of doing it for all filesystems in alloc_super().

    [Jan Kara: Export dquot_operations and vfs_quotactl_ops]

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Christoph Hellwig
     
  • Currently the VFS calls into the quotactl interface for unmounting
    filesystems. This means filesystems with their own quota handling
    can't easily distinguish between user-space originating quotaoff
    and an unount. Instead move the responsibily of the unmount handling
    into the filesystem to be consistent with all other dquot handling.

    Note that we do call dquot_disable a lot later now, e.g. after
    a sync_filesystem. But this is fine as the quota code does all its
    writes via blockdev's mapping and that is synced even later.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Christoph Hellwig
     
  • Instead of having wrappers in the VFS namespace export the dquot_suspend
    and dquot_resume helpers directly. Also rename vfs_quota_disable to
    dquot_disable while we're at it.

    [Jan Kara: Moved dquot_suspend to quotaops.h and made it inline]

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Christoph Hellwig
     
  • Currently do_remount_sb calls into the dquot code to tell it about going
    from rw to ro and ro to rw. Move this code into the filesystem to
    not depend on the dquot code in the VFS - note ocfs2 already ignores
    these calls and handles remount by itself. This gets rid of overloading
    the quotactl calls and allows to unify the VFS and XFS codepaths in
    that area later.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Christoph Hellwig
     

22 May, 2010

7 commits

  • The BKL is still used in ext2_put_super(), ext2_fill_super(), ext2_sync_fs()
    ext2_remount() and ext2_write_inode(). From these calls ext2_put_super(),
    ext2_fill_super() and ext2_remount() are protected against each other by
    the struct super_block s_umount rw semaphore. The call in ext2_write_inode()
    could only protect the modification of the ext2_sb_info through
    ext2_update_dynamic_rev() against concurrent ext2_sync_fs() or ext2_remount().
    ext2_fill_super() and ext2_put_super() can be left out because you need a
    valid filesystem reference in all three cases, which you do not have when
    you are one of these functions.

    If the BKL is only protecting the modification of the ext2_sb_info it can
    safely be removed since this is protected by the struct ext2_sb_info s_lock.

    Signed-off-by: Jan Blunck
    Cc: Jan Kara
    Signed-off-by: Jan Kara

    Jan Blunck
     
  • Add a spinlock that protects against concurrent modifications of
    s_mount_state, s_blocks_last, s_overhead_last and the content of the
    superblock's buffer pointed to by sbi->s_es. The spinlock is now used in
    ext2_xattr_update_super_block() which was setting the
    EXT2_FEATURE_COMPAT_EXT_ATTR flag on the superblock without protection
    before. Likewise the spinlock is used in ext2_show_options() to have a
    consistent view of the mount options.

    This is a preparation patch for removing the BKL from ext2 in the next
    patch.

    Signed-off-by: Jan Blunck
    Cc: Andi Kleen
    Cc: Jan Kara
    Cc: OGAWA Hirofumi
    Signed-off-by: Jan Kara

    Jan Blunck
     
  • Move ext2_write_super() out of ext2_setup_super() as a preparation for the
    next patch that adds a new lock for superblock fields.

    Signed-off-by: Jan Blunck
    Signed-off-by: Jan Kara

    Jan Blunck
     
  • Both function originally did similar things except that ext2_sync_super()
    is returning after the call to sync_dirty_buffer(sbh). Therefore this
    patch adds a wait flag to tell ext2_sync_super() if it has to call
    sync_dirty_buffer() to wait for in-progress I/O to finish.

    Signed-off-by: Jan Blunck
    Signed-off-by: Jan Kara

    Jan Blunck
     
  • Depending in the state (valid or unchecked) of the filesystem either
    ext2_sync_super() or ext2_commit_super() is called. If the filesystem is
    currently valid (it is checked), we first mark it unchecked and afterwards
    duplicate the work that ext2_sync_super() is doing later. Therefore this
    patch removes the duplicate code and calls ext2_sync_super() directly after
    marking the filesystem unchecked.

    Signed-off-by: Jan Blunck
    Signed-off-by: Jan Kara

    Jan Blunck
     
  • This is probably a typo since the write time should actually be updated by
    ext2_sync_fs() instead of the mount time.

    Signed-off-by: Jan Blunck
    Signed-off-by: Jan Kara

    Jan Blunck
     
  • ext2_sync_fs() used to duplicate the code from ext2_clear_super_error().

    Signed-off-by: Jan Blunck
    Signed-off-by: Jan Kara

    Jan Blunck
     

05 Mar, 2010

2 commits

  • Get rid of the drop dquot operation - it is now always called from
    the filesystem and if a filesystem really needs it's own (which none
    currently does) it can just call into it's own routine directly.

    Rename the now static low-level dquot_drop helper to __dquot_drop
    and vfs_dq_drop to dquot_drop to have a consistent namespace.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Christoph Hellwig
     
  • Currently clear_inode calls vfs_dq_drop directly. This means
    we tie the quota code into the VFS. Get rid of that and make the
    filesystem responsible for the drop inside the ->clear_inode
    superblock operation.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Christoph Hellwig
     

16 Dec, 2009

1 commit


10 Dec, 2009

2 commits

  • This fixes a WARN backtrace in mark_buffer_dirty() that occurs during
    unmount when a USB or floppy device is removed. I reported this a kernel
    regression, but looks like it might have been there for longer
    than that.

    The super block update from a previous operation has marked the buffer
    as in error, and the flag has to be cleared before doing the update.
    (Similar code already exists in ext4).

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Jan Kara

    Stephen Hemminger
     
  • make messages produced by ext2 more unified. It should be
    easy to parse.

    dmesg before patch:
    [ 4893.684892] reservations ON
    [ 4893.684896] xip option not supported
    [ 4893.684961] EXT2-fs warning: mounting ext3 filesystem as ext2
    [ 4893.684964] EXT2-fs warning: maximal mount count reached, running
    e2fsck is recommended
    [ 4893.684990] EXT II FS: 0.5b, 95/08/09, bs=1024, fs=1024, gc=2,
    bpg=8192, ipg=1280, mo=80010]

    dmesg after patch:
    [ 4893.684892] EXT2-fs (loop0): reservations ON
    [ 4893.684896] EXT2-fs (loop0): xip option not supported
    [ 4893.684961] EXT2-fs (loop0): warning: mounting ext3 filesystem as
    ext2
    [ 4893.684964] EXT2-fs (loop0): warning: maximal mount count reached,
    running e2fsck is recommended
    [ 4893.684990] EXT2-fs (loop0): 0.5b, 95/08/09, bs=1024, fs=1024, gc=2,
    bpg=8192, ipg=1280, mo=80010]

    Signed-off-by: Alexey Fisher
    Reviewed-by: Andreas Dilger
    Signed-off-by: Jan Kara

    Alexey Fisher
     

24 Jun, 2009

1 commit


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
     
  • [xfs, btrfs, capifs, shmem don't need BKL, exempt]

    Signed-off-by: Alessio Igor Bogani
    Signed-off-by: Al Viro

    Alessio Igor Bogani
     
  • 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
     

18 May, 2009

1 commit


27 Apr, 2009

1 commit


26 Mar, 2009

1 commit

  • ext2_quota_read() doesn't initialize tmp_bh.b_size before calling
    ext2_get_block() where we access it. Since it is a local variable it
    might contain some garbage. Make sure it is filled with reasonable
    value before passing.

    Signed-off-by: Manish Katiyar
    Signed-off-by: Jan Kara

    Manish Katiyar