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


22 Mar, 2012

1 commit

  • Pull vfs pile 1 from Al Viro:
    "This is _not_ all; in particular, Miklos' and Jan's stuff is not there
    yet."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (64 commits)
    ext4: initialization of ext4_li_mtx needs to be done earlier
    debugfs-related mode_t whack-a-mole
    hfsplus: add an ioctl to bless files
    hfsplus: change finder_info to u32
    hfsplus: initialise userflags
    qnx4: new helper - try_extent()
    qnx4: get rid of qnx4_bread/qnx4_getblk
    take removal of PF_FORKNOEXEC to flush_old_exec()
    trim includes in inode.c
    um: uml_dup_mmap() relies on ->mmap_sem being held, but activate_mm() doesn't hold it
    um: embed ->stub_pages[] into mmu_context
    gadgetfs: list_for_each_safe() misuse
    ocfs2: fix leaks on failure exits in module_init
    ecryptfs: make register_filesystem() the last potential failure exit
    ntfs: forgets to unregister sysctls on register_filesystem() failure
    logfs: missing cleanup on register_filesystem() failure
    jfs: mising cleanup on register_filesystem() failure
    make configfs_pin_fs() return root dentry on success
    configfs: configfs_create_dir() has parent dentry in dentry->d_parent
    configfs: sanitize configfs_create()
    ...

    Linus Torvalds
     

21 Mar, 2012

1 commit


20 Mar, 2012

1 commit


05 Mar, 2012

2 commits

  • Implement ->direct_IO() method in aops. The ->direct_IO() method combines
    the existing fuse_direct_read/fuse_direct_write methods to implement
    O_DIRECT functionality.

    Reaching ->direct_IO() in the read path via generic_file_aio_read ensures
    proper synchronization with page cache with its existing framework.

    Reaching ->direct_IO() in the write path via fuse_file_aio_write is made
    to come via generic_file_direct_write() which makes it play nice with
    the page cache w.r.t other mmap pages etc.

    On files marked 'direct_io' by the filesystem server, IO always follows
    the fuse_direct_read/write path. There is no effect of fcntl(O_DIRECT)
    and it always succeeds.

    On files not marked with 'direct_io' by the filesystem server, the IO
    path depends on O_DIRECT flag by the application. This can be passed
    at the time of open() as well as via fcntl().

    Note that asynchronous O_DIRECT iocb jobs are completed synchronously
    always (this has been the case with FUSE even before this patch)

    Signed-off-by: Anand Avati
    Reviewed-by: Jeff Moyer
    Signed-off-by: Miklos Szeredi

    Anand Avati
     
  • Anand Avati reports that the following sequence of system calls fail on a fuse
    filesystem:

    create("filename") => 0
    link("filename", "linkname") => 0
    unlink("filename") => 0
    link("linkname", "filename") => -ENOENT ### BUG ###

    vfs_link() fails with ENOENT if i_nlink is zero, this is done to prevent
    resurrecting already deleted files.

    Fuse clears i_nlink on unlink even if there are other links pointing to the
    file.

    Reported-by: Anand Avati
    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     

13 Jan, 2012

1 commit


07 Jan, 2012

1 commit


04 Jan, 2012

3 commits