28 Apr, 2014

16 commits


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
     

08 Apr, 2014

1 commit

  • filemap_map_pages() is generic implementation of ->map_pages() for
    filesystems who uses page cache.

    It should be safe to use filemap_map_pages() for ->map_pages() if
    filesystem use filemap_fault() for ->fault().

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Linus Torvalds
    Cc: Mel Gorman
    Cc: Rik van Riel
    Cc: Andi Kleen
    Cc: Matthew Wilcox
    Cc: Dave Hansen
    Cc: Alexander Viro
    Cc: Dave Chinner
    Cc: Ning Qu
    Cc: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

07 Apr, 2014

1 commit

  • Pull module updates from Rusty Russell:
    "Nothing major: the stricter permissions checking for sysfs broke a
    staging driver; fix included. Greg KH said he'd take the patch but
    hadn't as the merge window opened, so it's included here to avoid
    breaking build"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    staging: fix up speakup kobject mode
    Use 'E' instead of 'X' for unsigned module taint flag.
    VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms.
    kallsyms: fix percpu vars on x86-64 with relocation.
    kallsyms: generalize address range checking
    module: LLVMLinux: Remove unused function warning from __param_check macro
    Fix: module signature vs tracepoints: add new TAINT_UNSIGNED_MODULE
    module: remove MODULE_GENERIC_TABLE
    module: allow multiple calls to MODULE_DEVICE_TABLE() per module
    module: use pr_cont

    Linus Torvalds
     

05 Apr, 2014

2 commits

  • Pull ext4 updates from Ted Ts'o:
    "Major changes for 3.14 include support for the newly added ZERO_RANGE
    and COLLAPSE_RANGE fallocate operations, and scalability improvements
    in the jbd2 layer and in xattr handling when the extended attributes
    spill over into an external block.

    Other than that, the usual clean ups and minor bug fixes"

    * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (42 commits)
    ext4: fix premature freeing of partial clusters split across leaf blocks
    ext4: remove unneeded test of ret variable
    ext4: fix comment typo
    ext4: make ext4_block_zero_page_range static
    ext4: atomically set inode->i_flags in ext4_set_inode_flags()
    ext4: optimize Hurd tests when reading/writing inodes
    ext4: kill i_version support for Hurd-castrated file systems
    ext4: each filesystem creates and uses its own mb_cache
    fs/mbcache.c: doucple the locking of local from global data
    fs/mbcache.c: change block and index hash chain to hlist_bl_node
    ext4: Introduce FALLOC_FL_ZERO_RANGE flag for fallocate
    ext4: refactor ext4_fallocate code
    ext4: Update inode i_size after the preallocation
    ext4: fix partial cluster handling for bigalloc file systems
    ext4: delete path dealloc code in ext4_ext_handle_uninitialized_extents
    ext4: only call sync_filesystm() when remounting read-only
    fs: push sync_filesystem() down to the file system's remount_fs()
    jbd2: improve error messages for inconsistent journal heads
    jbd2: minimize region locked by j_list_lock in jbd2_journal_forget()
    jbd2: minimize region locked by j_list_lock in journal_get_create_access()
    ...

    Linus Torvalds
     
  • Pull fuse update from Miklos Szeredi:
    "This series adds cached writeback support to fuse, improving write
    throughput"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
    fuse: fix "uninitialized variable" warning
    fuse: Turn writeback cache on
    fuse: Fix O_DIRECT operations vs cached writeback misorder
    fuse: fuse_flush() should wait on writeback
    fuse: Implement write_begin/write_end callbacks
    fuse: restructure fuse_readpage()
    fuse: Flush files on wb close
    fuse: Trust kernel i_mtime only
    fuse: Trust kernel i_size only
    fuse: Connection bit for enabling writeback
    fuse: Prepare to handle short reads
    fuse: Linking file to inode helper

    Linus Torvalds
     

04 Apr, 2014

1 commit

  • Reclaim will be leaving shadow entries in the page cache radix tree upon
    evicting the real page. As those pages are found from the LRU, an
    iput() can lead to the inode being freed concurrently. At this point,
    reclaim must no longer install shadow pages because the inode freeing
    code needs to ensure the page tree is really empty.

    Add an address_space flag, AS_EXITING, that the inode freeing code sets
    under the tree lock before doing the final truncate. Reclaim will check
    for this flag before installing shadow pages.

    Signed-off-by: Johannes Weiner
    Reviewed-by: Rik van Riel
    Reviewed-by: Minchan Kim
    Cc: Andrea Arcangeli
    Cc: Bob Liu
    Cc: Christoph Hellwig
    Cc: Dave Chinner
    Cc: Greg Thelen
    Cc: Hugh Dickins
    Cc: Jan Kara
    Cc: KOSAKI Motohiro
    Cc: Luigi Semenzato
    Cc: Mel Gorman
    Cc: Metin Doslu
    Cc: Michel Lespinasse
    Cc: Ozgun Erdogan
    Cc: Peter Zijlstra
    Cc: Roman Gushchin
    Cc: Ryan Mallon
    Cc: Tejun Heo
    Cc: Vlastimil Babka
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     

02 Apr, 2014

16 commits

  • Fix the following warning:

    In file included from include/linux/fs.h:16:0,
    from fs/fuse/fuse_i.h:13,
    from fs/fuse/file.c:9:
    fs/fuse/file.c: In function 'fuse_file_poll':
    include/linux/rbtree.h:82:28: warning: 'parent' may be used
    uninitialized in this function [-Wmaybe-uninitialized]
    fs/fuse/file.c:2592:27: note: 'parent' was declared here

    Signed-off-by: Rajat Jain
    Signed-off-by: Miklos Szeredi

    Rajat Jain
     
  • Introduce a bit kernel and userspace exchange between each-other on
    the init stage and turn writeback on if the userspace want this and
    mount option 'allow_wbcache' is present (controlled by fusermount).

    Also add each writable file into per-inode write list and call the
    generic_file_aio_write to make use of the Linux page cache engine.

    Signed-off-by: Maxim Patlasov
    Signed-off-by: Miklos Szeredi

    Pavel Emelyanov
     
  • The problem is:

    1. write cached data to a file
    2. read directly from the same file (via another fd)

    The 2nd operation may read stale data, i.e. the one that was in a file
    before the 1st op. Problem is in how fuse manages writeback.

    When direct op occurs the core kernel code calls filemap_write_and_wait
    to flush all the cached ops in flight. But fuse acks the writeback right
    after the ->writepages callback exits w/o waiting for the real write to
    happen. Thus the subsequent direct op proceeds while the real writeback
    is still in flight. This is a problem for backends that reorder operation.

    Fix this by making the fuse direct IO callback explicitly wait on the
    in-flight writeback to finish.

    Signed-off-by: Maxim Patlasov
    Signed-off-by: Miklos Szeredi

    Pavel Emelyanov
     
  • The aim of .flush fop is to hint file-system that flushing its state or caches
    or any other important data to reliable storage would be desirable now.
    fuse_flush() passes this hint by sending FUSE_FLUSH request to userspace.
    However, dirty pages and pages under writeback may be not visible to userspace
    yet if we won't ensure it explicitly.

    Signed-off-by: Maxim Patlasov
    Signed-off-by: Miklos Szeredi

    Maxim Patlasov
     
  • The .write_begin and .write_end are requiered to use generic routines
    (generic_file_aio_write --> ... --> generic_perform_write) for buffered
    writes.

    Signed-off-by: Maxim Patlasov
    Signed-off-by: Miklos Szeredi

    Pavel Emelyanov
     
  • Move the code filling and sending read request to a separate function. Future
    patches will use it for .write_begin -- partial modification of a page
    requires reading the page from the storage very similarly to what fuse_readpage
    does.

    Signed-off-by: Maxim Patlasov
    Signed-off-by: Miklos Szeredi

    Maxim Patlasov
     
  • Any write request requires a file handle to report to the userspace. Thus
    when we close a file (and free the fuse_file with this info) we have to
    flush all the outstanding dirty pages.

    filemap_write_and_wait() is enough because every page under fuse writeback
    is accounted in ff->count. This delays actual close until all fuse wb is
    completed.

    In case of "write cache" turned off, the flush is ensured by fuse_vma_close().

    Signed-off-by: Maxim Patlasov
    Signed-off-by: Miklos Szeredi

    Pavel Emelyanov
     
  • Let the kernel maintain i_mtime locally:
    - clear S_NOCMTIME
    - implement i_op->update_time()
    - flush mtime on fsync and last close
    - update i_mtime explicitly on truncate and fallocate

    Fuse inode flag FUSE_I_MTIME_DIRTY serves as indication that local i_mtime
    should be flushed to the server eventually.

    Signed-off-by: Maxim Patlasov
    Signed-off-by: Miklos Szeredi

    Maxim Patlasov
     
  • Make fuse think that when writeback is on the inode's i_size is always
    up-to-date and not update it with the value received from the userspace.
    This is done because the page cache code may update i_size without letting
    the FS know.

    This assumption implies fixing the previously introduced short-read helper --
    when a short read occurs the 'hole' is filled with zeroes.

    fuse_file_fallocate() is also fixed because now we should keep i_size up to
    date, so it must be updated if FUSE_FALLOCATE request succeeded.

    Signed-off-by: Maxim V. Patlasov
    Signed-off-by: Miklos Szeredi

    Pavel Emelyanov
     
  • Off (0) by default. Will be used in the next patches and will be turned
    on at the very end.

    Signed-off-by: Maxim Patlasov
    Signed-off-by: Pavel Emelyanov
    Signed-off-by: Miklos Szeredi

    Pavel Emelyanov
     
  • A helper which gets called when read reports less bytes than was requested.
    See patch "trust kernel i_size only" for details.

    Signed-off-by: Maxim Patlasov
    Signed-off-by: Pavel Emelyanov
    Signed-off-by: Miklos Szeredi

    Pavel Emelyanov
     
  • When writeback is ON every writeable file should be in per-inode write list,
    not only mmap-ed ones. Thus introduce a helper for this linkage.

    Signed-off-by: Maxim Patlasov
    Signed-off-by: Pavel Emelyanov
    Signed-off-by: Miklos Szeredi

    Pavel Emelyanov
     
  • always equal to &iocb->ki_pos.

    Signed-off-by: Al Viro

    Al Viro
     
  • ... it does that itself (via kmap_atomic())

    Signed-off-by: Al Viro

    Al Viro
     
  • all pipe_buffer_operations have the same instances of those...

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     

24 Mar, 2014

1 commit

  • Summary of http://lkml.org/lkml/2014/3/14/363 :

    Ted: module_param(queue_depth, int, 444)
    Joe: 0444!
    Rusty: User perms >= group perms >= other perms?
    Joe: CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2?

    Side effect of stricter permissions means removing the unnecessary
    S_IFREG from several callers.

    Note that the BUILD_BUG_ON_ZERO((perm) & 2) test was removed: a fair
    number of drivers fail this test, so that will be the debate for a
    future patch.

    Suggested-by: Joe Perches
    Acked-by: Bjorn Helgaas for drivers/pci/slot.c
    Acked-by: Greg Kroah-Hartman
    Cc: Miklos Szeredi
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Rusty Russell

    Rusty Russell
     

13 Mar, 2014

1 commit

  • Previously, the no-op "mount -o mount /dev/xxx" operation when the
    file system is already mounted read-write causes an implied,
    unconditional syncfs(). This seems pretty stupid, and it's certainly
    documented or guaraunteed to do this, nor is it particularly useful,
    except in the case where the file system was mounted rw and is getting
    remounted read-only.

    However, it's possible that there might be some file systems that are
    actually depending on this behavior. In most file systems, it's
    probably fine to only call sync_filesystem() when transitioning from
    read-write to read-only, and there are some file systems where this is
    not needed at all (for example, for a pseudo-filesystem or something
    like romfs).

    Signed-off-by: "Theodore Ts'o"
    Cc: linux-fsdevel@vger.kernel.org
    Cc: Christoph Hellwig
    Cc: Artem Bityutskiy
    Cc: Adrian Hunter
    Cc: Evgeniy Dushistov
    Cc: Jan Kara
    Cc: OGAWA Hirofumi
    Cc: Anders Larsen
    Cc: Phillip Lougher
    Cc: Kees Cook
    Cc: Mikulas Patocka
    Cc: Petr Vandrovec
    Cc: xfs@oss.sgi.com
    Cc: linux-btrfs@vger.kernel.org
    Cc: linux-cifs@vger.kernel.org
    Cc: samba-technical@lists.samba.org
    Cc: codalist@coda.cs.cmu.edu
    Cc: linux-ext4@vger.kernel.org
    Cc: linux-f2fs-devel@lists.sourceforge.net
    Cc: fuse-devel@lists.sourceforge.net
    Cc: cluster-devel@redhat.com
    Cc: linux-mtd@lists.infradead.org
    Cc: jfs-discussion@lists.sourceforge.net
    Cc: linux-nfs@vger.kernel.org
    Cc: linux-nilfs@vger.kernel.org
    Cc: linux-ntfs-dev@lists.sourceforge.net
    Cc: ocfs2-devel@oss.oracle.com
    Cc: reiserfs-devel@vger.kernel.org

    Theodore Ts'o