04 Jan, 2012

1 commit


02 Nov, 2011

1 commit


23 Jul, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits)
    vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp
    isofs: Remove global fs lock
    jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory
    fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.
    mm/truncate.c: fix build for CONFIG_BLOCK not enabled
    fs:update the NOTE of the file_operations structure
    Remove dead code in dget_parent()
    AFS: Fix silly characters in a comment
    switch d_add_ci() to d_splice_alias() in "found negative" case as well
    simplify gfs2_lookup()
    jfs_lookup(): don't bother with . or ..
    get rid of useless dget_parent() in btrfs rename() and link()
    get rid of useless dget_parent() in fs/btrfs/ioctl.c
    fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
    drivers: fix up various ->llseek() implementations
    fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
    Ext4: handle SEEK_HOLE/SEEK_DATA generically
    Btrfs: implement our own ->llseek
    fs: add SEEK_HOLE and SEEK_DATA flags
    reiserfs: make reiserfs default to barrier=flush
    ...

    Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new
    shrinker callout for the inode cache, that clashed with the xfs code to
    start the periodic workers later.

    Linus Torvalds
     

21 Jul, 2011

3 commits

  • Btrfs needs to be able to control how filemap_write_and_wait_range() is called
    in fsync to make it less of a painful operation, so push down taking i_mutex and
    the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some
    file systems can drop taking the i_mutex altogether it seems, like ext3 and
    ocfs2. For correctness sake I just pushed everything down in all cases to make
    sure that we keep the current behavior the same for everybody, and then each
    individual fs maintainer can make up their mind about what to do from there.
    Thanks,

    Acked-by: Jan Kara
    Signed-off-by: Josef Bacik
    Signed-off-by: Al Viro

    Josef Bacik
     
  • Simple filesystems always pass inode->i_sb_bdev as the block device
    argument, and never need a end_io handler. Let's simply things for
    them and for my grepping activity by dropping these arguments. The
    only thing not falling into that scheme is ext4, which passes and
    end_io handler without needing special flags (yet), but given how
    messy the direct I/O code there is use of __blockdev_direct_IO
    in one instead of two out of three cases isn't going to make a large
    difference anyway.

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

    Christoph Hellwig
     
  • Let filesystems handle waiting for direct I/O requests themselves instead
    of doing it beforehand. This means filesystem-specific locks to prevent
    new dio referenes from appearing can be held. This is important to allow
    generalizing i_dio_count to non-DIO_LOCKING filesystems.

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

    Christoph Hellwig
     

07 Jul, 2011

1 commit

  • hfs_find_init() may fail with ENOMEM, but there are places, where
    the returned value is not checked. The consequences can be very
    unpleasant, e.g. kfree uninitialized pointer and
    inappropriate mutex unlocking.

    The patch adds checks for errors in hfs_find_init().

    Found by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Alexey Khoroshilov
    Signed-off-by: Christoph Hellwig

    Alexey Khoroshilov
     

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
     

17 Dec, 2010

2 commits


23 Nov, 2010

5 commits

  • Flush the disk cache in fsync and sync to make sure data actually is
    on disk on completion of these system calls. There is a nobarrier
    mount option to disable this behaviour. It's slightly misnamed now
    that barrier actually are gone, but it matches the name used by all
    major filesystems.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     
  • Avoid doing unessecary work in fsync. Do nothing unless the inode
    was marked dirty, and only write the various metadata inodes out if
    they contain any dirty state from this inode. This is archived by
    adding three new dirty bits to the hfsplus-specific inode which are
    set in the correct places.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     
  • Split the flags field in the hfsplus inode into an extent_state
    flag that is locked by the extent_lock, and a new flags field
    that uses atomic bitops. The second will grow more flags in the
    next patch.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     
  • fsync is supposed to not just work on regular files, but also on
    directories. Fortunately enough hfsplus_file_fsync works just fine
    for directories, so we can just wire it up.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     
  • Remove lots of code we don't need from fsync, we just need to call
    ->write_inode on the inode if it's dirty, for which sync_inode_metadata
    is a lot more efficient than write_inode_now, and we need to write
    out the various metadata inodes, which we now do explicitly instead
    of by calling ->sync_fs.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     

26 Oct, 2010

1 commit


14 Oct, 2010

3 commits

  • Make sure the initial insertation of the catalog entry already contains
    the device number by calling init_special_inode early and setting writing
    out the dev field of the on-disk permission structure. The latter is
    facilitated by sharing the almost identical hfsplus_set_perms helpers
    between initial catalog entry creating and ->write_inode.

    Unless we crashed just after mknod this bug was harmless as the inode
    is marked dirty at the end of hfsplus_mknod, and hfsplus_write_inode
    will update the catalog entry to contain the correct value.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     
  • The rootflags field in hfsplus_inode_info only caches the immutable and
    append-only flags in the VFS inode, so we can easily get rid of it.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     
  • HFS implements hardlink by using indirect catalog entries that refer to a hidden
    directly. The link target is cached in the dev field in the HFS+ specific
    inode, which is also used for the device number for device files, and inside
    for passing the nlink value of the indirect node from hfsplus_cat_write_inode
    to a helper function. Now if we happen to write out the indirect node while
    hfsplus_link is creating the catalog entry we'll get a link pointing to the
    linkid of the current nlink value. This can easily be reproduced by a large
    enough loop of local git-clone operations.

    Stop abusing the dev field in the HFS+ inode for short term storage by
    refactoring the way the permission structure in the catalog entry is
    set up, and rename the dev field to linkid to avoid any confusion.

    While we're at it also prevent creating hard links to special files, as
    the HFS+ dev and linkid share the same space in the on-disk structure.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     

01 Oct, 2010

3 commits

  • We never walk the list - the only reason for it is to make the resource fork
    inodes appear hashed to the writeback code. Borrow a trick from JFS to do
    that without needing a list head.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     
  • HFSPLUS_I doesn't return a pointer to the hfsplus-specific inode
    information like all other FOO_I macros, but dereference the pointer in a way
    that made it look like a direct struct derefence. This only works as long
    as the HFSPLUS_I macro is used directly and prevents us from keepig a local
    hfsplus_inode_info pointer. Fix the calling convention and introduce a local
    hip variable in all functions that use it constantly.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     
  • HFSPLUS_SB doesn't return a pointer to the hfsplus-specific superblock
    information like all other FOO_SB macros, but dereference the pointer in a way
    that made it look like a direct struct derefence. This only works as long
    as the HFSPLUS_SB macro is used directly and prevents us from keepig a local
    hfsplus_sb_info pointer. Fix the calling convention and introduce a local
    sbi variable in all functions that use it constantly.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     

10 Aug, 2010

5 commits

  • Copy and simplify in the only two users remaining.

    Signed-off-by: Al Viro

    Al Viro
     
  • Replace inode_setattr with opencoded variants of it in all callers. This
    moves the remaining call to vmtruncate into the filesystem methods where it
    can be replaced with the proper truncate sequence.

    In a few cases it was obvious that we would never end up calling vmtruncate
    so it was left out in the opencoded variant:

    spufs: explicitly checks for ATTR_SIZE earlier
    btrfs,hugetlbfs,logfs,dlmfs: explicitly clears ATTR_SIZE earlier
    ufs: contains an opencoded simple_seattr + truncate that sets the filesize just above

    In addition to that ncpfs called inode_setattr with handcrafted iattrs,
    which allowed to trim down the opencoded variant.

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

    Christoph Hellwig
     
  • For the new truncate sequence every filesystem that wants to truncate on-disk
    state needs a seattr method. Convert the remaining filesystems that implement
    the truncate inode operation to have its own setattr method.

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

    Christoph Hellwig
     
  • 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 cont_write_begin.

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

    Christoph Hellwig
     
  • Move the call to vmtruncate to get rid of accessive blocks to the callers
    in prepearation of the new truncate calling sequence. This was only done
    for DIO_LOCKING filesystems, so the __blockdev_direct_IO_newtrunc variant
    was not needed anyway. Get rid of blockdev_direct_IO_no_locking and
    its _newtrunc variant while at it as just opencoding the two additional
    paramters is shorted than the name suffix.

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

    Christoph Hellwig
     

17 May, 2010

1 commit


28 Mar, 2009

1 commit


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: Roman Zippel
    Signed-off-by: James Morris

    David Howells
     

23 Oct, 2008

1 commit

  • For execute permission on a regular files we need to check if file has
    any execute bits at all, regardless of capabilites.

    This check is normally performed by generic_permission() but was also
    added to the case when the filesystem defines its own ->permission()
    method. In the latter case the filesystem should be responsible for
    performing this check.

    Move the check from inode_permission() inside filesystems which are
    not calling generic_permission().

    Create a helper function execute_ok() that returns true if the inode
    is a directory or if any execute bits are present in i_mode.

    Also fix up the following code:

    - coda control file is never executable
    - sysctl files are never executable
    - hfs_permission seems broken on MAY_EXEC, remove
    - hfsplus_permission is eqivalent to generic_permission(), remove

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     

20 Oct, 2008

1 commit

  • hfsplus: O_LARGEFILE checking is missing

    Addresses http://bugzilla.kernel.org/show_bug.cgi?id=8490

    From: Alan Cox
    Reported-by: didier
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     

27 Jul, 2008

2 commits

  • make it atomic_long_t; while we are at it, get rid of useless checks in affs,
    hfs and hpfs - ->open() always has it equal to 1, ->release() - to 0.

    Signed-off-by: Al Viro

    Al Viro
     
  • * kill nameidata * argument; map the 3 bits in ->flags anybody cares
    about to new MAY_... ones and pass with the mask.
    * kill redundant gfs2_iop_permission()
    * sanitize ecryptfs_permission()
    * fix remaining places where ->permission() instances might barf on new
    MAY_... found in mask.

    The obvious next target in that direction is permission(9)

    folded fix for nfs_permission() breakage from Miklos Szeredi

    Signed-off-by: Al Viro

    Al Viro
     

26 Jul, 2008

1 commit


13 May, 2008

1 commit

  • Fix an oops with a corrupted hfs+ image.

    See http://bugzilla.kernel.org/show_bug.cgi?id=10548 for details.

    Problem is that we call hfs_btree_open() from hfsplus_fill_super() to set
    HFSPLUS_SB(sb).[ext_tree|cat_tree] Both trees are still NULL at this moment.
    If hfs_btree_open() fails for any reason it calls iput() on the page, which
    gets to hfsplus_releasepage() which tries to access HFSPLUS_SB(sb).* which is
    still NULL and oopses while dereferencing it.

    [akpm@linux-foundation.org: build fix]
    Signed-off-by: Eric Sesterhenn
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sesterhenn
     

29 Apr, 2008

1 commit


17 Oct, 2007

1 commit


17 Jul, 2007

1 commit

  • Add custom dentry hash and comparison operations for HFS+ filesystems that are
    case-insensitive and/or do automatic unicode decomposition. The new
    operations reuse the existing HFS+ ASCII to unicode conversion, unicode
    decomposition and case folding functionality.

    Signed-off-by: Duane Griffin
    Signed-off-by: Roman Zippel

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

    Duane Griffin
     

10 Jul, 2007

1 commit