13 Apr, 2014

1 commit

  • Pull vfs updates from Al Viro:
    "The first vfs pile, with deep apologies for being very late in this
    window.

    Assorted cleanups and fixes, plus a large preparatory part of iov_iter
    work. There's a lot more of that, but it'll probably go into the next
    merge window - it *does* shape up nicely, removes a lot of
    boilerplate, gets rid of locking inconsistencie between aio_write and
    splice_write and I hope to get Kent's direct-io rewrite merged into
    the same queue, but some of the stuff after this point is having
    (mostly trivial) conflicts with the things already merged into
    mainline and with some I want more testing.

    This one passes LTP and xfstests without regressions, in addition to
    usual beating. BTW, readahead02 in ltp syscalls testsuite has started
    giving failures since "mm/readahead.c: fix readahead failure for
    memoryless NUMA nodes and limit readahead pages" - might be a false
    positive, might be a real regression..."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits)
    missing bits of "splice: fix racy pipe->buffers uses"
    cifs: fix the race in cifs_writev()
    ceph_sync_{,direct_}write: fix an oops on ceph_osdc_new_request() failure
    kill generic_file_buffered_write()
    ocfs2_file_aio_write(): switch to generic_perform_write()
    ceph_aio_write(): switch to generic_perform_write()
    xfs_file_buffered_aio_write(): switch to generic_perform_write()
    export generic_perform_write(), start getting rid of generic_file_buffer_write()
    generic_file_direct_write(): get rid of ppos argument
    btrfs_file_aio_write(): get rid of ppos
    kill the 5th argument of generic_file_buffered_write()
    kill the 4th argument of __generic_file_aio_write()
    lustre: don't open-code kernel_recvmsg()
    ocfs2: don't open-code kernel_recvmsg()
    drbd: don't open-code kernel_recvmsg()
    constify blk_rq_map_user_iov() and friends
    lustre: switch to kernel_sendmsg()
    ocfs2: don't open-code kernel_sendmsg()
    take iov_iter stuff to mm/iov_iter.c
    process_vm_access: tidy up a bit
    ...

    Linus Torvalds
     

05 Apr, 2014

1 commit

  • Pull xfs update from Dave Chinner:
    "There are a couple of new fallocate features in this request - it was
    decided that it was easiest to push them through the XFS tree using
    topic branches and have the ext4 support be based on those branches.
    Hence you may see some overlap with the ext4 tree merge depending on
    how they including those topic branches into their tree. Other than
    that, there is O_TMPFILE support, some cleanups and bug fixes.

    The main changes in the XFS tree for 3.15-rc1 are:

    - O_TMPFILE support
    - allowing AIO+DIO writes beyond EOF
    - FALLOC_FL_COLLAPSE_RANGE support for fallocate syscall and XFS
    implementation
    - FALLOC_FL_ZERO_RANGE support for fallocate syscall and XFS
    implementation
    - IO verifier cleanup and rework
    - stack usage reduction changes
    - vm_map_ram NOIO context fixes to remove lockdep warings
    - various bug fixes and cleanups"

    * tag 'xfs-for-linus-3.15-rc1' of git://oss.sgi.com/xfs/xfs: (34 commits)
    xfs: fix directory hash ordering bug
    xfs: extra semi-colon breaks a condition
    xfs: Add support for FALLOC_FL_ZERO_RANGE
    fs: Introduce FALLOC_FL_ZERO_RANGE flag for fallocate
    xfs: inode log reservations are still too small
    xfs: xfs_check_page_type buffer checks need help
    xfs: avoid AGI/AGF deadlock scenario for inode chunk allocation
    xfs: use NOIO contexts for vm_map_ram
    xfs: don't leak EFSBADCRC to userspace
    xfs: fix directory inode iolock lockdep false positive
    xfs: allocate xfs_da_args to reduce stack footprint
    xfs: always do log forces via the workqueue
    xfs: modify verifiers to differentiate CRC from other errors
    xfs: print useful caller information in xfs_error_report
    xfs: add xfs_verifier_error()
    xfs: add helper for updating checksums on xfs_bufs
    xfs: add helper for verifying checksums on xfs_bufs
    xfs: Use defines for CRC offsets in all cases
    xfs: skip pointless CRC updates after verifier failures
    xfs: Add support FALLOC_FL_COLLAPSE_RANGE for fallocate
    ...

    Linus Torvalds
     

02 Apr, 2014

5 commits


13 Mar, 2014

1 commit

  • Introduce new FALLOC_FL_ZERO_RANGE flag for fallocate. This has the same
    functionality as xfs ioctl XFS_IOC_ZERO_RANGE.

    It can be used to convert a range of file to zeros preferably without
    issuing data IO. Blocks should be preallocated for the regions that span
    holes in the file, and the entire range is preferable converted to
    unwritten extents - even though file system may choose to zero out the
    extent or do whatever which will result in reading zeros from the range
    while the range remains allocated for the file.

    This can be also used to preallocate blocks past EOF in the same way as
    with fallocate. Flag FALLOC_FL_KEEP_SIZE which should cause the inode
    size to remain the same.

    Signed-off-by: Lukas Czerner
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner

    Lukas Czerner
     

10 Mar, 2014

1 commit

  • Our write() system call has always been atomic in the sense that you get
    the expected thread-safe contiguous write, but we haven't actually
    guaranteed that concurrent writes are serialized wrt f_pos accesses, so
    threads (or processes) that share a file descriptor and use "write()"
    concurrently would quite likely overwrite each others data.

    This violates POSIX.1-2008/SUSv4 Section XSI 2.9.7 that says:

    "2.9.7 Thread Interactions with Regular File Operations

    All of the following functions shall be atomic with respect to each
    other in the effects specified in POSIX.1-2008 when they operate on
    regular files or symbolic links: [...]"

    and one of the effects is the file position update.

    This unprotected file position behavior is not new behavior, and nobody
    has ever cared. Until now. Yongzhi Pan reported unexpected behavior to
    Michael Kerrisk that was due to this.

    This resolves the issue with a f_pos-specific lock that is taken by
    read/write/lseek on file descriptors that may be shared across threads
    or processes.

    Reported-by: Yongzhi Pan
    Reported-by: Michael Kerrisk
    Cc: Al Viro
    Signed-off-by: Linus Torvalds
    Signed-off-by: Al Viro

    Linus Torvalds
     

24 Feb, 2014

1 commit

  • This patch is in response of the following post:
    http://lwn.net/Articles/556136/
    "ext4: introduce two new ioctls"

    Dave chinner suggested that truncate_block_range
    (which was one of the ioctls name) should be a fallocate operation
    and not any fs specific ioctl, hence we add this functionality to new flags of fallocate.

    This new functionality of collapsing range could be used by media editing tools
    which does non linear editing to quickly purge and edit parts of a media file.
    This will immensely improve the performance of these operations.
    The limitation of fs block size aligned offsets can be easily handled
    by media codecs which are encapsulated in a conatiner as they have to
    just change the offset to next keyframe value to match the proper alignment.

    Signed-off-by: Namjae Jeon
    Signed-off-by: Ashish Sangwan
    Reviewed-by: Dave Chinner
    Signed-off-by: Dave Chinner

    Namjae Jeon
     

09 Nov, 2013

2 commits


25 Oct, 2013

1 commit


17 Sep, 2013

1 commit

  • Fix documentation of ->atomic_open() and related functions: finish_open()
    and finish_no_open(). Also add details that seem to be unclear and a
    source of bugs (some of which are fixed in the following series).

    Cc-ing maintainers of all filesystems implementing ->atomic_open().

    Signed-off-by: Miklos Szeredi
    Cc: Eric Van Hensbergen
    Cc: Sage Weil
    Cc: Steve French
    Cc: Steven Whitehouse
    Cc: Trond Myklebust
    Signed-off-by: Al Viro

    Miklos Szeredi
     

08 Sep, 2013

1 commit

  • Pull namespace changes from Eric Biederman:
    "This is an assorted mishmash of small cleanups, enhancements and bug
    fixes.

    The major theme is user namespace mount restrictions. nsown_capable
    is killed as it encourages not thinking about details that need to be
    considered. A very hard to hit pid namespace exiting bug was finally
    tracked and fixed. A couple of cleanups to the basic namespace
    infrastructure.

    Finally there is an enhancement that makes per user namespace
    capabilities usable as capabilities, and an enhancement that allows
    the per userns root to nice other processes in the user namespace"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
    userns: Kill nsown_capable it makes the wrong thing easy
    capabilities: allow nice if we are privileged
    pidns: Don't have unshare(CLONE_NEWPID) imply CLONE_THREAD
    userns: Allow PR_CAPBSET_DROP in a user namespace.
    namespaces: Simplify copy_namespaces so it is clear what is going on.
    pidns: Fix hang in zap_pid_ns_processes by sending a potentially extra wakeup
    sysfs: Restrict mounting sysfs
    userns: Better restrictions on when proc and sysfs can be mounted
    vfs: Don't copy mount bind mounts of /proc//ns/mnt between namespaces
    kernel/nsproxy.c: Improving a snippet of code.
    proc: Restrict mounting the proc filesystem
    vfs: Lock in place mounts from more privileged users

    Linus Torvalds
     

04 Sep, 2013

1 commit


31 Aug, 2013

1 commit


05 Aug, 2013

1 commit

  • O_TMPFILE, like O_CREAT, should respect the requested mode and should
    create regular files.

    This fixes two bugs: O_TMPFILE required privilege (because the mode
    ended up as 000) and it produced bogus inodes with no type.

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Al Viro

    Andy Lutomirski
     

20 Jul, 2013

1 commit


13 Jul, 2013

1 commit

  • [suggested by Rasmus Villemoes] make O_DIRECTORY | O_RDWR part of O_TMPFILE;
    that will fail on old kernels in a lot more cases than what I came up with.
    And make sure O_CREAT doesn't get there...

    Signed-off-by: Al Viro

    Al Viro
     

29 Jun, 2013

2 commits


04 Mar, 2013

3 commits

  • ... and switch i386 to HAVE_SYSCALL_WRAPPERS, killing open-coded
    uses of asmlinkage_protect() in a bunch of syscalls.

    Signed-off-by: Al Viro

    Al Viro
     
  • ... and convert a bunch of SYSCALL_DEFINE ones to SYSCALL_DEFINE,
    killing the boilerplate crap around them.

    Signed-off-by: Al Viro

    Al Viro
     
  • Pull more VFS bits from Al Viro:
    "Unfortunately, it looks like xattr series will have to wait until the
    next cycle ;-/

    This pile contains 9p cleanups and fixes (races in v9fs_fid_add()
    etc), fixup for nommu breakage in shmem.c, several cleanups and a bit
    more file_inode() work"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    constify path_get/path_put and fs_struct.c stuff
    fix nommu breakage in shmem.c
    cache the value of file_inode() in struct file
    9p: if v9fs_fid_lookup() gets to asking server, it'd better have hashed dentry
    9p: make sure ->lookup() adds fid to the right dentry
    9p: untangle ->lookup() a bit
    9p: double iput() in ->lookup() if d_materialise_unique() fails
    9p: v9fs_fid_add() can't fail now
    v9fs: get rid of v9fs_dentry
    9p: turn fid->dlist into hlist
    9p: don't bother with private lock in ->d_fsdata; dentry->d_lock will do just fine
    more file_inode() open-coded instances
    selinux: opened file can't have NULL or negative ->f_path.dentry

    (In the meantime, the hlist traversal macros have changed, so this
    required a semantic conflict fixup for the newly hlistified fid->dlist)

    Linus Torvalds
     

03 Mar, 2013

1 commit

  • Pull signal/compat fixes from Al Viro:
    "Fixes for several regressions introduced in the last signal.git pile,
    along with fixing bugs in truncate and ftruncate compat (on just about
    anything biarch at least one of those two had been done wrong)."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal:
    compat: restore timerfd settime and gettime compat syscalls
    [regression] braino in "sparc: convert to ksignal"
    fix compat truncate/ftruncate
    switch lseek to COMPAT_SYSCALL_DEFINE
    lseek() and truncate() on sparc really need sign extension

    Linus Torvalds
     

02 Mar, 2013

1 commit


26 Feb, 2013

1 commit


25 Feb, 2013

1 commit


23 Feb, 2013

2 commits


21 Dec, 2012

7 commits


19 Nov, 2012

1 commit


13 Oct, 2012

1 commit

  • ...and fix up the callers. For do_file_open_root, just declare a
    struct filename on the stack and fill out the .name field. For
    do_filp_open, make it also take a struct filename pointer, and fix up its
    callers to call it appropriately.

    For filp_open, add a variant that takes a struct filename pointer and turn
    filp_open into a wrapper around it.

    Signed-off-by: Jeff Layton
    Signed-off-by: Al Viro

    Jeff Layton