27 Apr, 2015

1 commit

  • Pull fourth vfs update from Al Viro:
    "d_inode() annotations from David Howells (sat in for-next since before
    the beginning of merge window) + four assorted fixes"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    RCU pathwalk breakage when running into a symlink overmounting something
    fix I_DIO_WAKEUP definition
    direct-io: only inc/dec inode->i_dio_count for file systems
    fs/9p: fix readdir()
    VFS: assorted d_backing_inode() annotations
    VFS: fs/inode.c helpers: d_inode() annotations
    VFS: fs/cachefiles: d_backing_inode() annotations
    VFS: fs library helpers: d_inode() annotations
    VFS: assorted weird filesystems: d_inode() annotations
    VFS: normal filesystems (and lustre): d_inode() annotations
    VFS: security/: d_inode() annotations
    VFS: security/: d_backing_inode() annotations
    VFS: net/: d_inode() annotations
    VFS: net/unix: d_backing_inode() annotations
    VFS: kernel/: d_inode() annotations
    VFS: audit: d_backing_inode() annotations
    VFS: Fix up some ->d_inode accesses in the chelsio driver
    VFS: Cachefiles should perform fs modifications on the top layer only
    VFS: AF_UNIX sockets should call mknod on the top layer only

    Linus Torvalds
     

17 Apr, 2015

2 commits

  • Pull third hunk of vfs changes from Al Viro:
    "This contains the ->direct_IO() changes from Omar + saner
    generic_write_checks() + dealing with fcntl()/{read,write}() races
    (mirroring O_APPEND/O_DIRECT into iocb->ki_flags and instead of
    repeatedly looking at ->f_flags, which can be changed by fcntl(2),
    check ->ki_flags - which cannot) + infrastructure bits for dhowells'
    d_inode annotations + Christophs switch of /dev/loop to
    vfs_iter_write()"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (30 commits)
    block: loop: switch to VFS ITER_BVEC
    configfs: Fix inconsistent use of file_inode() vs file->f_path.dentry->d_inode
    VFS: Make pathwalk use d_is_reg() rather than S_ISREG()
    VFS: Fix up debugfs to use d_is_dir() in place of S_ISDIR()
    VFS: Combine inode checks with d_is_negative() and d_is_positive() in pathwalk
    NFS: Don't use d_inode as a variable name
    VFS: Impose ordering on accesses of d_inode and d_flags
    VFS: Add owner-filesystem positive/negative dentry checks
    nfs: generic_write_checks() shouldn't be done on swapout...
    ocfs2: use __generic_file_write_iter()
    mirror O_APPEND and O_DIRECT into iocb->ki_flags
    switch generic_write_checks() to iocb and iter
    ocfs2: move generic_write_checks() before the alignment checks
    ocfs2_file_write_iter: stop messing with ppos
    udf_file_write_iter: reorder and simplify
    fuse: ->direct_IO() doesn't need generic_write_checks()
    ext4_file_write_iter: move generic_write_checks() up
    xfs_file_aio_write_checks: switch to iocb/iov_iter
    generic_write_checks(): drop isblk argument
    blkdev_write_iter: expand generic_file_checks() call in there
    ...

    Linus Torvalds
     
  • Pull quota and udf updates from Jan Kara:
    "The pull contains quota changes which complete unification of XFS and
    VFS quota interfaces (so tools can use either interface to manipulate
    any filesystem). There's also a patch to support project quotas in
    VFS quota subsystem from Li Xi.

    Finally there's a bunch of UDF fixes and cleanups and tiny cleanup in
    reiserfs & ext3"

    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: (21 commits)
    udf: Update ctime and mtime when directory is modified
    udf: return correct errno for udf_update_inode()
    ext3: Remove useless condition in if statement.
    vfs: Add general support to enforce project quota limits
    reiserfs: fix __RASSERT format string
    udf: use int for allocated blocks instead of sector_t
    udf: remove redundant buffer_head.h includes
    udf: remove else after return in __load_block_bitmap()
    udf: remove unused variable in udf_table_free_blocks()
    quota: Fix maximum quota limit settings
    quota: reorder flags in quota state
    quota: paranoia: check quota tree root
    quota: optimize i_dquot access
    quota: Hook up Q_XSETQLIM for id 0 to ->set_info
    xfs: Add support for Q_SETINFO
    quota: Make ->set_info use structure with neccesary info to VFS and XFS
    quota: Remove ->get_xstate and ->get_xstatev callbacks
    gfs2: Convert to using ->get_state callback
    xfs: Convert to using ->get_state callback
    quota: Wire up Q_GETXSTATE and Q_GETXSTATV calls to work with ->get_state
    ...

    Linus Torvalds
     

16 Apr, 2015

1 commit


12 Apr, 2015

8 commits


01 Apr, 2015

2 commits


26 Mar, 2015

1 commit


16 Mar, 2015

1 commit

  • Fix the following warnings:

    fs/udf/balloc.c:768:15: warning: conversion to 'sector_t' from 'int'
    may change the sign of the result [-Wsign-conversion]
    allocated = udf_bitmap_prealloc_blocks(sb,
    ^
    fs/udf/balloc.c:773:15: warning: conversion to 'sector_t' from 'int'
    may change the sign of the result [-Wsign-conversion]
    allocated = udf_table_prealloc_blocks(sb,
    ^
    fs/udf/balloc.c:778:15: warning: conversion to 'sector_t' from 'int'
    may change the sign of the result [-Wsign-conversion]
    allocated = udf_bitmap_prealloc_blocks(sb,
    ^
    fs/udf/balloc.c:783:15: warning: conversion to 'sector_t' from 'int'
    may change the sign of the result [-Wsign-conversion]
    allocated = udf_table_prealloc_blocks(sb,
    ^
    fs/udf/balloc.c:791:26: warning: conversion to 'loff_t' from 'sector_t'
    may change the sign of the result [-Wsign-conversion]
    inode_add_bytes(inode, allocated << sb->s_blocksize_bits);
    ^
    fs/udf/balloc.c:792:2: warning: conversion to 'int' from 'sector_t'
    may alter its value [-Wconversion]
    return allocated;

    Suggested-by: Jan Kara
    Signed-off-by: Fabian Frederick
    Signed-off-by: Jan Kara

    Fabian Frederick
     

14 Mar, 2015

3 commits


13 Mar, 2015

1 commit


05 Feb, 2015

2 commits


30 Jan, 2015

1 commit


28 Jan, 2015

1 commit

  • Commit 6fb1ca92a640 "udf: Fix race between write(2) and close(2)"
    changed the condition when preallocation is released. The idea was that
    we don't want to release the preallocation for an inode on close when
    there are other writeable file descriptors for the inode. However the
    condition was written in the opposite way so we released preallocation
    only if there were other writeable file descriptors. Fix the problem by
    changing the condition properly.

    CC: stable@vger.kernel.org
    Fixes: 6fb1ca92a6409a9d5b0696447cd4997bc9aaf5a2
    Reported-by: Fabian Frederick
    Signed-off-by: Jan Kara

    Jan Kara
     

12 Jan, 2015

1 commit

  • Call mutex_destroy() on superblock mutex in udf_put_super()
    otherwise mutex debugging code isn't able to detect that
    mutex is used after being freed.
    (thanks to Jan Kara for complete definition).

    Signed-off-by: Fabian Frederick
    Signed-off-by: Jan Kara

    Fabian Frederick
     

07 Jan, 2015

2 commits


05 Jan, 2015

1 commit


22 Dec, 2014

2 commits

  • Replace repeated dereferences like dir->i_sb by storing superblock
    pointer in a variable and using that.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Check that length specified in a component of a symlink fits in the
    input buffer we are reading. Also properly ignore component length for
    component types that do not use it. Otherwise we read memory after end
    of buffer for corrupted udf image.

    Reported-by: Carl Henrik Lunde
    CC: stable@vger.kernel.org
    Signed-off-by: Jan Kara

    Jan Kara
     

19 Dec, 2014

3 commits

  • Symlink reading code does not check whether the resulting path fits into
    the page provided by the generic code. This isn't as easy as just
    checking the symlink size because of various encoding conversions we
    perform on path. So we have to check whether there is still enough space
    in the buffer on the fly.

    CC: stable@vger.kernel.org
    Reported-by: Carl Henrik Lunde
    Signed-off-by: Jan Kara

    Jan Kara
     
  • UDF specification allows arbitrarily large symlinks. However we support
    only symlinks at most one block large. Check the length of the symlink
    so that we don't access memory beyond end of the symlink block.

    CC: stable@vger.kernel.org
    Reported-by: Carl Henrik Lunde
    Signed-off-by: Jan Kara

    Jan Kara
     
  • Verify that inode size is sane when loading inode with data stored in
    ICB. Otherwise we may get confused later when working with the inode and
    inode size is too big.

    CC: stable@vger.kernel.org
    Reported-by: Carl Henrik Lunde
    Signed-off-by: Jan Kara

    Jan Kara
     

20 Nov, 2014

2 commits


09 Oct, 2014

1 commit

  • Some UDF media have special inodes (like VAT or metadata partition
    inodes) whose link_count is 0. Thus commit 4071b9136223 (udf: Properly
    detect stale inodes) broke loading these inodes because udf_iget()
    started returning -ESTALE for them. Since we still need to properly
    detect stale inodes queried by NFS, create two variants of udf_iget() -
    one which is used for looking up special inodes (which ignores
    link_count == 0) and one which is used for other cases which return
    ESTALE when link_count == 0.

    Fixes: 4071b913622316970d0e1919f7d82b4403fec5f2
    CC: stable@vger.kernel.org
    Signed-off-by: Jan Kara

    Jan Kara
     

29 Sep, 2014

1 commit


17 Sep, 2014

1 commit

  • Currently write(2) updating i_size and close(2) of the file can race in
    such a way that udf_truncate_tail_extent() called from
    udf_file_release() sees old i_size but already new extents added by the
    running write call. This results in complaints like:
    UDF-fs: warning (device vdb2): udf_truncate_tail_extent: Too long extent
    after EOF in inode 877: i_size: 0 lbcount: 1073739776 extent 0+1073739776
    UDF-fs: error (device vdb2): udf_truncate_tail_extent: Extent after EOF
    in inode 877

    Fix the problem by grabbing i_mutex in udf_file_release() to be sure
    i_size is consistent with current state of extent list. Also avoid
    truncating tail extent unnecessarily when the file is still open for
    writing.

    Signed-off-by: Jan Kara

    Jan Kara
     

05 Sep, 2014

2 commits

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

    Al Viro
     
  • Currently udf_iget() (triggered by NFS) can race with udf_new_inode()
    leading to two inode structures with the same inode number:

    nfsd: iget_locked() creates inode
    nfsd: try to read from disk, block on that.
    udf_new_inode(): allocate inode with that inumber
    udf_new_inode(): insert it into icache, set it up and dirty
    udf_write_inode(): write inode into buffer cache
    nfsd: get CPU again, look into buffer cache, see nice and sane on-disk
    inode, set the in-core inode from it

    Fix the problem by putting inode into icache in locked state (I_NEW set)
    and unlocking it only after it's fully set up.

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

    Al Viro