18 Dec, 2012

2 commits

  • Merge misc patches from Andrew Morton:
    "Incoming:

    - lots of misc stuff

    - backlight tree updates

    - lib/ updates

    - Oleg's percpu-rwsem changes

    - checkpatch

    - rtc

    - aoe

    - more checkpoint/restart support

    I still have a pile of MM stuff pending - Pekka should be merging
    later today after which that is good to go. A number of other things
    are twiddling thumbs awaiting maintainer merges."

    * emailed patches from Andrew Morton : (180 commits)
    scatterlist: don't BUG when we can trivially return a proper error.
    docs: update documentation about /proc//fdinfo/ fanotify output
    fs, fanotify: add @mflags field to fanotify output
    docs: add documentation about /proc//fdinfo/ output
    fs, notify: add procfs fdinfo helper
    fs, exportfs: add exportfs_encode_inode_fh() helper
    fs, exportfs: escape nil dereference if no s_export_op present
    fs, epoll: add procfs fdinfo helper
    fs, eventfd: add procfs fdinfo helper
    procfs: add ability to plug in auxiliary fdinfo providers
    tools/testing/selftests/kcmp/kcmp_test.c: print reason for failure in kcmp_test
    breakpoint selftests: print failure status instead of cause make error
    kcmp selftests: print fail status instead of cause make error
    kcmp selftests: make run_tests fix
    mem-hotplug selftests: print failure status instead of cause make error
    cpu-hotplug selftests: print failure status instead of cause make error
    mqueue selftests: print failure status instead of cause make error
    vm selftests: print failure status instead of cause make error
    ubifs: use prandom_bytes
    mtd: nandsim: use prandom_bytes
    ...

    Linus Torvalds
     
  • But the kernel decided to call it "origin" instead. Fix most of the
    sites.

    Acked-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

15 Nov, 2012

1 commit

  • Use kuid_t and kgid_t in struct fuse_conn and struct fuse_mount_data.

    The connection between between a fuse filesystem and a fuse daemon is
    established when a fuse filesystem is mounted and provided with a file
    descriptor the fuse daemon created by opening /dev/fuse.

    For now restrict the communication of uids and gids between the fuse
    filesystem and the fuse daemon to the initial user namespace. Enforce
    this by verifying the file descriptor passed to the mount of fuse was
    opened in the initial user namespace. Ensuring the mount happens in
    the initial user namespace is not necessary as mounts from non-initial
    user namespaces are not yet allowed.

    In fuse_req_init_context convert the currrent fsuid and fsgid into the
    initial user namespace for the request that will be sent to the fuse
    daemon.

    In fuse_fill_attr convert the uid and gid passed from the fuse daemon
    from the initial user namespace into kuids and kgids.

    In iattr_to_fattr called from fuse_setattr convert kuids and kgids
    into the uids and gids in the initial user namespace before passing
    them to the fuse filesystem.

    In fuse_change_attributes_common called from fuse_dentry_revalidate,
    fuse_permission, fuse_geattr, and fuse_setattr, and fuse_iget convert
    the uid and gid from the fuse daemon into a kuid and a kgid to store
    on the fuse inode.

    By default fuse mounts are restricted to task whose uid, suid, and
    euid matches the fuse user_id and whose gid, sgid, and egid matches
    the fuse group id. Convert the user_id and group_id mount options
    into kuids and kgids at mount time, and use uid_eq and gid_eq to
    compare the in fuse_allow_task.

    Cc: Miklos Szeredi
    Acked-by: Serge Hallyn
    Signed-off-by: Eric W. Biederman

    Eric W. Biederman
     

09 Oct, 2012

1 commit

  • Move actual pte filling for non-linear file mappings into the new special
    vma operation: ->remap_pages().

    Filesystems must implement this method to get non-linear mapping support,
    if it uses filemap_fault() then generic_file_remap_pages() can be used.

    Now device drivers can implement this method and obtain nonlinear vma support.

    Signed-off-by: Konstantin Khlebnikov
    Cc: Alexander Viro
    Cc: Carsten Otte
    Cc: Chris Metcalf #arch/tile
    Cc: Cyrill Gorcunov
    Cc: Eric Paris
    Cc: H. Peter Anvin
    Cc: Hugh Dickins
    Cc: Ingo Molnar
    Cc: James Morris
    Cc: Jason Baron
    Cc: Kentaro Takeda
    Cc: Matt Helsley
    Cc: Nick Piggin
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Suresh Siddha
    Cc: Tetsuo Handa
    Cc: Venkatesh Pallipadi
    Acked-by: Linus Torvalds
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Konstantin Khlebnikov
     

03 Oct, 2012

1 commit

  • There's no reason to call rcu_barrier() on every
    deactivate_locked_super(). We only need to make sure that all delayed rcu
    free inodes are flushed before we destroy related cache.

    Removing rcu_barrier() from deactivate_locked_super() affects some fast
    paths. E.g. on my machine exit_group() of a last process in IPC
    namespace takes 0.07538s. rcu_barrier() takes 0.05188s of that time.

    Signed-off-by: Kirill A. Shutemov
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Kirill A. Shutemov
     

27 Sep, 2012

1 commit


05 Sep, 2012

1 commit


03 Sep, 2012

1 commit

  • gcc 4.6.3 complains about uninitialized variables in fs/fuse/control.c:

    CC fs/fuse/control.o
    fs/fuse/control.c: In function 'fuse_conn_congestion_threshold_write':
    fs/fuse/control.c:165:29: warning: 'val' may be used uninitialized in this function [-Wuninitialized]
    fs/fuse/control.c: In function 'fuse_conn_max_background_write':
    fs/fuse/control.c:128:23: warning: 'val' may be used uninitialized in this function [-Wuninitialized]

    fuse_conn_limit_write() will always return non-zero unless the &val
    is modified, so the warning is misleading. Let the compiler know
    about it by marking 'val' with 'uninitialized_var'.

    Signed-off-by: Daniel Mack
    Cc: Brian Foster
    Signed-off-by: Miklos Szeredi

    Daniel Mack
     

31 Aug, 2012

2 commits

  • Luca Risolia reported that a CUSE daemon will continue to run even if
    initialization of the emulated device failes for some reason (e.g. the device
    number is already registered by another driver).

    This patch disconnects the fuse device on error, which will make the userspace
    CUSE daemon exit, albeit without indication about what the problem was.

    Reported-by: Luca Risolia
    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     
  • fuse_conn_kill() removed fc->entry, called fuse_ctl_remove_conn() and
    fuse_bdi_destroy(). None of which is appropriate for cuse cleanup.

    The fuse_ctl_remove_conn() decrements the nlink on the control filesystem, which
    is totally bogus. The others are harmless but unnecessary.

    So move these out from fuse_conn_kill() to fuse_put_super() where they belong.

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     

19 Aug, 2012

1 commit

  • Pull vfs fixes from Miklos Szeredi.

    This mainly fixes some confusion about whether the open 'mode' variable
    passed around should contain the full file type (S_IFREG etc)
    information or just the permission mode. In particular, the lack of
    proper file type information had confused fuse.

    * 'vfs-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
    vfs: fix propagation of atomic_open create error on negative dentry
    fuse: check create mode in atomic open
    vfs: pass right create mode to may_o_create()
    vfs: atomic_open(): fix create mode usage
    vfs: canonicalize create mode in build_open_flags()

    Linus Torvalds
     

17 Aug, 2012

1 commit


15 Aug, 2012

1 commit


07 Aug, 2012

1 commit

  • Commit 7572777eef78ebdee1ecb7c258c0ef94d35bad16 attempted to verify that
    the total iovec from the client doesn't overflow iov_length() but it
    only checked the first element. The iovec could still overflow by
    starting with a small element. The obvious fix is to check all the
    elements.

    The overflow case doesn't look dangerous to the kernel as the copy is
    limited by the length after the overflow. This fix restores the
    intention of returning an error instead of successfully copying less
    than the iovec represented.

    I found this by code inspection. I built it but don't have a test case.
    I'm cc:ing stable because the initial commit did as well.

    Signed-off-by: Zach Brown
    Signed-off-by: Miklos Szeredi
    CC: [2.6.37+]

    Zach Brown
     

31 Jul, 2012

1 commit


18 Jul, 2012

4 commits

  • Add missing flags that userspace derived from the protocol version number. This
    makes the protocol more flexible.

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     
  • A fuse-based network filesystem might allow for the inode
    and/or file data to change unexpectedly. A local client
    that opens and repeatedly reads a file might never pick
    up on such changes and indefinitely return stale data.

    Always invoke fuse_update_attributes() in the read path
    to cause an attr revalidation when the attributes expire.
    This leads to a page cache invalidation if necessary and
    ensures fuse issues new read requests to the fuse client.

    The original logic (reval only on reads beyond EOF) is
    preserved unless the client specifies FUSE_AUTO_INVAL_DATA
    on init.

    Signed-off-by: Brian Foster
    Signed-off-by: Miklos Szeredi

    Brian Foster
     
  • We currently invalidate the inode address space mapping
    if the file size changes unexpectedly. In the case of a
    fuse network filesystem, a portion of a file could be
    overwritten remotely without changing the file size.
    Compare the old mtime as well to detect this condition
    and invalidate the mapping if the file has been updated.

    The original logic (to ignore changes in mtime) is
    preserved unless the client specifies FUSE_AUTO_INVAL_DATA
    on init.

    Signed-off-by: Brian Foster
    Signed-off-by: Miklos Szeredi

    Brian Foster
     
  • FUSE_AUTO_INVAL_DATA is provided to enable updated/auto cache
    invalidation logic.

    Signed-off-by: Brian Foster
    Signed-off-by: Miklos Szeredi

    Brian Foster
     

14 Jul, 2012

9 commits


06 Jun, 2012

1 commit


02 Jun, 2012

1 commit

  • Btrfs has to make sure we have space to allocate new blocks in order to modify
    the inode, so updating time can fail. We've gotten around this by having our
    own file_update_time but this is kind of a pain, and Christoph has indicated he
    would like to make xfs do something different with atime updates. So introduce
    ->update_time, where we will deal with i_version an a/m/c time updates and
    indicate which changes need to be made. The normal version just does what it
    has always done, updates the time and marks the inode dirty, and then
    filesystems can choose to do something different.

    I've gone through all of the users of file_update_time and made them check for
    errors with the exception of the fault code since it's complicated and I wasn't
    quite sure what to do there, also Jan is going to be pushing the file time
    updates into page_mkwrite for those who have it so that should satisfy btrfs and
    make it not a big deal to check the file_update_time() return code in the
    generic fault path. Thanks,

    Signed-off-by: Josef Bacik

    Josef Bacik
     

30 May, 2012

1 commit

  • pass inode + parent's inode or NULL instead of dentry + bool saying
    whether we want the parent or not.

    NOTE: that needs ceph fix folded in.

    Signed-off-by: Al Viro

    Al Viro
     

29 May, 2012

1 commit

  • Pull writeback tree from Wu Fengguang:
    "Mainly from Jan Kara to avoid iput() in the flusher threads."

    * tag 'writeback' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
    writeback: Avoid iput() from flusher thread
    vfs: Rename end_writeback() to clear_inode()
    vfs: Move waiting for inode writeback from end_writeback() to evict_inode()
    writeback: Refactor writeback_single_inode()
    writeback: Remove wb->list_lock from writeback_single_inode()
    writeback: Separate inode requeueing after writeback
    writeback: Move I_DIRTY_PAGES handling
    writeback: Move requeueing when I_SYNC set to writeback_sb_inodes()
    writeback: Move clearing of I_SYNC into inode_sync_complete()
    writeback: initialize global_dirty_limit
    fs: remove 8 bytes of padding from struct writeback_control on 64 bit builds
    mm: page-writeback.c: local functions should not be exposed globally

    Linus Torvalds
     

14 May, 2012

2 commits

  • Don't use inode->i_blkbits which might be stale, instead calculate the blksize
    information from the freshly obtained attributes.

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     
  • Now we store attr->ino at inode->i_ino, return attr->ino at the
    first time and then return inode->i_ino if the attribute timeout
    isn't expired. That's wrong on 32 bit platforms because attr->ino
    is 64 bit and inode->i_ino is 32 bit in this case.

    Fix this by saving 64 bit ino in fuse_inode structure and returning
    it every time we call getattr. Also squash attr->ino into inode->i_ino
    explicitly.

    Signed-off-by: Pavel Shilovsky
    Signed-off-by: Miklos Szeredi

    Pavel Shilovsky
     

06 May, 2012

1 commit

  • After we moved inode_sync_wait() from end_writeback() it doesn't make sense
    to call the function end_writeback() anymore. Rename it to clear_inode()
    which well says what the function really does - set I_CLEAR flag.

    Signed-off-by: Jan Kara
    Signed-off-by: Fengguang Wu

    Jan Kara
     

26 Apr, 2012

1 commit


25 Apr, 2012

2 commits

  • fallocate filesystem operation preallocates media space for the given file.
    If fallocate returns success then any subsequent write to the given range
    never fails with 'not enough space' error.

    Signed-off-by: Anatol Pomozov
    Signed-off-by: Miklos Szeredi

    Anatol Pomozov
     
  • This patch replaces the code for getting an number from a
    userspace buffer by a simple call to kstroul_from_user.
    This makes it easier to read and less error prone.

    Signed-off-by: Peter Huewe
    Signed-off-by: Miklos Szeredi

    Peter Huewe
     

19 Apr, 2012

1 commit


11 Apr, 2012

1 commit