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

5 commits


15 Dec, 2011

1 commit


14 Dec, 2011

1 commit


13 Dec, 2011

7 commits

  • Allows a FUSE file-system to tell the kernel when a file or directory is
    deleted. If the specified dentry has the specified inode number, the kernel will
    unhash it.

    The current 'fuse_notify_inval_entry' does not cause the kernel to clean up
    directories that are in use properly, and as a result the users of those
    directories see incorrect semantics from the file-system. The error condition
    seen when 'fuse_notify_inval_entry' is used to notify of a deleted directory is
    avoided when 'fuse_notify_delete' is used instead.

    The following scenario demonstrates the difference:
    1. User A chdirs into 'testdir' and starts reading 'testfile'.
    2. User B rm -rf 'testdir'.
    3. User B creates 'testdir'.
    4. User C chdirs into 'testdir'.

    If you run the above within the same machine on any file-system (including fuse
    file-systems), there is no problem: user C is able to chdir into the new
    testdir. The old testdir is removed from the dentry tree, but still open by user
    A.

    If operations 2 and 3 are performed via the network such that the fuse
    file-system uses one of the notify functions to tell the kernel that the nodes
    are gone, then the following error occurs for user C while user A holds the
    original directory open:

    muirj@empacher:~> ls /test/testdir
    ls: cannot access /test/testdir: No such file or directory

    The issue here is that the kernel still has a dentry for testdir, and so it is
    requesting the attributes for the old directory, while the file-system is
    responding that the directory no longer exists.

    If on the other hand, if the file-system can notify the kernel that the
    directory is deleted using the new 'fuse_notify_delete' function, then the above
    ls will find the new directory as expected.

    Signed-off-by: John Muir
    Signed-off-by: Miklos Szeredi

    John Muir
     
  • Multiplexing filesystems may want to support ioctls on the underlying
    files and directores (e.g. FS_IOC_{GET,SET}FLAGS).

    Ioctl support on directories was missing so add it now.

    Reported-by: Antonio SJ Musumeci
    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     
  • The advantage of kcalloc is, that will prevent integer overflows which could
    result from the multiplication of number of elements and size and it is also
    a bit nicer to read.

    The semantic patch that makes this change is available
    in https://lkml.org/lkml/2011/11/25/107

    Signed-off-by: Thomas Meyer
    Signed-off-by: Miklos Szeredi

    Thomas Meyer
     
  • Use generic_file_llseek() instead of open coding the seek function.

    i_mutex protection is only necessary for SEEK_END (and SEEK_HOLE, SEEK_DATA), so
    move SEEK_CUR and SEEK_SET out from under i_mutex.

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     
  • Fix race between lseek(fd, 0, SEEK_CUR) and read/write. This was fixed in
    generic code by commit 5b6f1eb97d (vfs: lseek(fd, 0, SEEK_CUR) race condition).

    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     
  • The test in fuse_file_llseek() "not SEEK_CUR or not SEEK_SET" always evaluates
    to true.

    This was introduced in 3.1 by commit 06222e49 (fs: handle SEEK_HOLE/SEEK_DATA
    properly in all fs's that define their own llseek) and changed the behavior of
    SEEK_CUR and SEEK_SET to always retrieve the file attributes. This is a
    performance regression.

    Fix the test so that it makes sense.

    Signed-off-by: Miklos Szeredi
    CC: stable@vger.kernel.org
    CC: Josef Bacik
    CC: Al Viro

    Roel Kluin
     
  • Fix two bugs in fuse_retrieve():

    - retrieving more than one page would yield repeated instances of the
    first page

    - if more than FUSE_MAX_PAGES_PER_REQ pages were requested than the
    request page array would overflow

    fuse_retrieve() was added in 2.6.36 and these bugs had been there since the
    beginning.

    Signed-off-by: Miklos Szeredi
    CC: stable@vger.kernel.org

    Miklos Szeredi
     

07 Nov, 2011

1 commit

  • * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
    Revert "tracing: Include module.h in define_trace.h"
    irq: don't put module.h into irq.h for tracking irqgen modules.
    bluetooth: macroize two small inlines to avoid module.h
    ip_vs.h: fix implicit use of module_get/module_put from module.h
    nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
    include: replace linux/module.h with "struct module" wherever possible
    include: convert various register fcns to macros to avoid include chaining
    crypto.h: remove unused crypto_tfm_alg_modname() inline
    uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
    pm_runtime.h: explicitly requires notifier.h
    linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
    miscdevice.h: fix up implicit use of lists and types
    stop_machine.h: fix implicit use of smp.h for smp_processor_id
    of: fix implicit use of errno.h in include/linux/of.h
    of_platform.h: delete needless include
    acpi: remove module.h include from platform/aclinux.h
    miscdevice.h: delete unnecessary inclusion of module.h
    device_cgroup.h: delete needless include
    net: sch_generic remove redundant use of
    net: inet_timewait_sock doesnt need
    ...

    Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
    - drivers/media/dvb/frontends/dibx000_common.c
    - drivers/media/video/{mt9m111.c,ov6650.c}
    - drivers/mfd/ab3550-core.c
    - include/linux/dmaengine.h

    Linus Torvalds
     

02 Nov, 2011

1 commit


01 Nov, 2011

1 commit

  • Some files were using the complete module.h infrastructure without
    actually including the header at all. Fix them up in advance so
    once the implicit presence is removed, we won't get failures like this:

    CC [M] fs/nfsd/nfssvc.o
    fs/nfsd/nfssvc.c: In function 'nfsd_create_serv':
    fs/nfsd/nfssvc.c:335: error: 'THIS_MODULE' undeclared (first use in this function)
    fs/nfsd/nfssvc.c:335: error: (Each undeclared identifier is reported only once
    fs/nfsd/nfssvc.c:335: error: for each function it appears in.)
    fs/nfsd/nfssvc.c: In function 'nfsd':
    fs/nfsd/nfssvc.c:555: error: implicit declaration of function 'module_put_and_exit'
    make[3]: *** [fs/nfsd/nfssvc.o] Error 1

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

13 Sep, 2011

2 commits

  • kmemleak is reporting that 32 bytes are being leaked by FUSE:

    unreferenced object 0xe373b270 (size 32):
    comm "fusermount", pid 1207, jiffies 4294707026 (age 2675.187s)
    hex dump (first 32 bytes):
    01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    backtrace:
    [] kmemleak_alloc+0x27/0x50
    [] kmem_cache_alloc+0xc5/0x180
    [] fuse_alloc_forget+0x1e/0x20
    [] fuse_alloc_inode+0xb0/0xd0
    [] alloc_inode+0x1c/0x80
    [] iget5_locked+0x8f/0x1a0
    [] fuse_iget+0x72/0x1a0
    [] fuse_get_root_inode+0x8a/0x90
    [] fuse_fill_super+0x3ef/0x590
    [] mount_nodev+0x3f/0x90
    [] fuse_mount+0x15/0x20
    [] mount_fs+0x1c/0xc0
    [] vfs_kern_mount+0x41/0x90
    [] do_kern_mount+0x39/0xd0
    [] do_mount+0x2e5/0x660
    [] sys_mount+0x66/0xa0

    This leak report is consistent and happens once per boot on
    3.1.0-rc5-dirty.

    This happens if a FORGET request is queued after the fuse device was
    released.

    Reported-by: Sitsofe Wheeler
    Signed-off-by: Miklos Szeredi
    Tested-by: Sitsofe Wheeler
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Commit 37fb3a30b4 ("fuse: fix flock") added in 3.1-rc4 caused flock() to
    fail with ENOSYS with the kernel ABI version 7.16 or earlier.

    Fix by falling back to testing FUSE_POSIX_LOCKS for ABI versions 7.16
    and earlier.

    Reported-by: Martin Ziegler
    Signed-off-by: Miklos Szeredi
    Tested-by: Martin Ziegler
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     

25 Aug, 2011

1 commit


24 Aug, 2011

1 commit


08 Aug, 2011

3 commits

  • As fuse does not use the page cache library functions when userspace
    writes to a file, it did not benefit from 'c8236db mm: mark page
    accessed before we write_end()' that made sure pages are properly
    marked accessed when written to.

    Signed-off-by: Johannes Weiner
    Signed-off-by: Miklos Szeredi

    Johannes Weiner
     
  • Ever since 'ea9b990 fuse: implement perform_write', the .write_begin
    and .write_end aops have been dead code.

    Their task - acquiring a page from the page cache, sending out a write
    request and releasing the page again - is now done batch-wise to
    maximize the number of pages send per userspace request.

    Signed-off-by: Johannes Weiner
    Signed-off-by: Miklos Szeredi

    Johannes Weiner
     
  • Commit a9ff4f87 "fuse: support BSD locking semantics" overlooked a
    number of issues with supporing flock locks over existing POSIX
    locking infrastructure:

    - it's not backward compatible, passing flock(2) calls to userspace
    unconditionally (if userspace sets FUSE_POSIX_LOCKS)

    - it doesn't cater for the fact that flock locks are automatically
    unlocked on file release

    - it doesn't take into account the fact that flock exclusive locks
    (write locks) don't need an fd opened for write.

    The last one invalidates the original premise of the patch that flock
    locks can be emulated with POSIX locks.

    This patch fixes the first two issues. The last one needs to be fixed
    in userspace if the filesystem assumed that a write lock will happen
    only on a file operned for write (as in the case of the current fuse
    library).

    Reported-by: Sebastian Pipping
    Signed-off-by: Miklos Szeredi

    Miklos Szeredi
     

26 Jul, 2011

1 commit

  • * 'for-3.1' of git://linux-nfs.org/~bfields/linux:
    nfsd: don't break lease on CLAIM_DELEGATE_CUR
    locks: rename lock-manager ops
    nfsd4: update nfsv4.1 implementation notes
    nfsd: turn on reply cache for NFSv4
    nfsd4: call nfsd4_release_compoundargs from pc_release
    nfsd41: Deny new lock before RECLAIM_COMPLETE done
    fs: locks: remove init_once
    nfsd41: check the size of request
    nfsd41: error out when client sets maxreq_sz or maxresp_sz too small
    nfsd4: fix file leak on open_downgrade
    nfsd4: remember to put RW access on stateid destruction
    NFSD: Added TEST_STATEID operation
    NFSD: added FREE_STATEID operation
    svcrpc: fix list-corrupting race on nfsd shutdown
    rpc: allow autoloading of gss mechanisms
    svcauth_unix.c: quiet sparse noise
    svcsock.c: include sunrpc.h to quiet sparse noise
    nfsd: Remove deprecated nfsctl system call and related code.
    NFSD: allow OP_DESTROY_CLIENTID to be only op in COMPOUND

    Fix up trivial conflicts in Documentation/feature-removal-schedule.txt

    Linus Torvalds
     

21 Jul, 2011

3 commits

  • Btrfs needs to be able to control how filemap_write_and_wait_range() is called
    in fsync to make it less of a painful operation, so push down taking i_mutex and
    the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some
    file systems can drop taking the i_mutex altogether it seems, like ext3 and
    ocfs2. For correctness sake I just pushed everything down in all cases to make
    sure that we keep the current behavior the same for everybody, and then each
    individual fs maintainer can make up their mind about what to do from there.
    Thanks,

    Acked-by: Jan Kara
    Signed-off-by: Josef Bacik
    Signed-off-by: Al Viro

    Josef Bacik
     
  • This converts everybody to handle SEEK_HOLE/SEEK_DATA properly. In some cases
    we just return -EINVAL, in others we do the normal generic thing, and in others
    we're simply making sure that the properly due-dilligence is done. For example
    in NFS/CIFS we need to make sure the file size is update properly for the
    SEEK_HOLE and SEEK_DATA case, but since it calls the generic llseek stuff itself
    that is all we have to do. Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Al Viro

    Josef Bacik
     
  • Both the filesystem and the lock manager can associate operations with a
    lock. Confusingly, one of them (fl_release_private) actually has the
    same name in both operation structures.

    It would save some confusion to give the lock-manager ops different
    names.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

20 Jul, 2011

3 commits