16 Aug, 2016

1 commit


15 Aug, 2016

1 commit

  • Mostly this is moving code into orangefs-debugfs.c so that globals turn
    into static globals.

    Then gossip_debug_mask is renamed orangefs_gossip_debug_mask but keeps
    global visibility, so it can be used from a macro.

    Signed-off-by: Martin Brandenburg

    Martin Brandenburg
     

09 Aug, 2016

1 commit

  • This has been dormant code for many years. Parts of it were removed from
    the OrangeFS kernel code when it went into mainline. These bits were missed.
    Now the readahead cache has been resurrected in the OrangeFS userspace
    portions. It was renamed there, since it doesn't really have anything to do
    with mmap specifically, so it will be renamed here.

    Signed-off-by: Martin Brandenburg

    Martin Brandenburg
     

03 Aug, 2016

3 commits


06 Jul, 2016

1 commit

  • In orangefs_inode_getxattr(), an fsuid is written to dmesg. The kuid is
    converted to a userspace uid via from_kuid(current_user_ns(), [...]), but
    since dmesg is global, init_user_ns should be used here instead.

    In copy_attributes_from_inode(), op_alloc() and fill_default_sys_attrs(),
    upcall structures are populated with uids/gids that have been mapped into
    the caller's namespace. However, those upcall structures are read by
    another process (the userspace filesystem driver), and that process might
    be running in another namespace. This effectively lets any user spoof its
    uid and gid as seen by the userspace filesystem driver.

    To fix the second issue, I just construct the opcall structures with
    init_user_ns uids/gids and require the filesystem server to run in the
    init namespace. Since orangefs is full of global state anyway (as the error
    message in DUMP_DEVICE_ERROR explains, there can only be one userspace
    orangefs filesystem driver at once), that shouldn't be a problem.

    [
    Why does orangefs even exist in the kernel if everything does upcalls into
    userspace? What does orangefs do that couldn't be done with the FUSE
    interface? If there is no good answer to those questions, I'd prefer to see
    orangefs kicked out of the kernel. Can that be done for something that
    shipped in a release?

    According to commit f7ab093f74bf ("Orangefs: kernel client part 1"), they
    even already have a FUSE daemon, and the only rational reason (apart from
    "but most of our users report preferring to use our kernel module instead")
    given for not wanting to use FUSE is one "in-the-works" feature that could
    probably be integated into FUSE instead.
    ]

    This patch has been compile-tested.

    Signed-off-by: Jann Horn
    Signed-off-by: Mike Marshall

    Jann Horn
     

10 Apr, 2016

1 commit

  • Pull orangefs fixes from Mike Marshall:
    "Orangefs cleanups and a strncpy vulnerability fix.

    Cleanups:
    - remove an unused variable from orangefs_readdir.
    - clean up printk wrapper used for ofs "gossip" debugging.
    - clean up truncate ctime and mtime setting in inode.c
    - remove a useless null check found by coccinelle.
    - optimize some memcpy/memset boilerplate code.
    - remove some useless sanity checks from xattr.c

    Fix:
    - fix a potential strncpy vulnerability"

    * tag 'for-linus-4.6-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux:
    orangefs: remove unused variable
    orangefs: Add KERN_ to gossip_ macros
    orangefs: strncpy -> strscpy
    orangefs: clean up truncate ctime and mtime setting
    Orangefs: fix ifnullfree.cocci warnings
    Orangefs: optimize boilerplate code.
    Orangefs: xattr.c cleanup

    Linus Torvalds
     

09 Apr, 2016

1 commit

  • It would have been possible for a rogue client-core to send in a symlink
    target which is not NUL terminated. This returns EIO if the client-core
    gives us corrupt data.

    Leave debugfs and superblock code as is for now.

    Other dcache.c and namei.c strncpy instances are safe because
    ORANGEFS_NAME_MAX = NAME_MAX + 1; there is always enough space for a
    name plus a NUL byte.

    Signed-off-by: Martin Brandenburg
    Signed-off-by: Mike Marshall

    Martin Brandenburg
     

05 Apr, 2016

1 commit

  • PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
    ago with promise that one day it will be possible to implement page
    cache with bigger chunks than PAGE_SIZE.

    This promise never materialized. And unlikely will.

    We have many places where PAGE_CACHE_SIZE assumed to be equal to
    PAGE_SIZE. And it's constant source of confusion on whether
    PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
    especially on the border between fs and mm.

    Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
    breakage to be doable.

    Let's stop pretending that pages in page cache are special. They are
    not.

    The changes are pretty straight-forward:

    - << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ;

    - >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ;

    - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};

    - page_cache_get() -> get_page();

    - page_cache_release() -> put_page();

    This patch contains automated changes generated with coccinelle using
    script below. For some reason, coccinelle doesn't patch header files.
    I've called spatch for them manually.

    The only adjustment after coccinelle is revert of changes to
    PAGE_CAHCE_ALIGN definition: we are going to drop it later.

    There are few places in the code where coccinelle didn't reach. I'll
    fix them manually in a separate patch. Comments and documentation also
    will be addressed with the separate patch.

    virtual patch

    @@
    expression E;
    @@
    - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
    + E

    @@
    expression E;
    @@
    - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
    + E

    @@
    @@
    - PAGE_CACHE_SHIFT
    + PAGE_SHIFT

    @@
    @@
    - PAGE_CACHE_SIZE
    + PAGE_SIZE

    @@
    @@
    - PAGE_CACHE_MASK
    + PAGE_MASK

    @@
    expression E;
    @@
    - PAGE_CACHE_ALIGN(E)
    + PAGE_ALIGN(E)

    @@
    expression E;
    @@
    - page_cache_get(E)
    + get_page(E)

    @@
    expression E;
    @@
    - page_cache_release(E)
    + put_page(E)

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Michal Hocko
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

24 Mar, 2016

5 commits


26 Feb, 2016

1 commit

  • The new orangefs code uses a helper function to read a time field to
    its private structures from struct iattr. This will conflict with the
    move to 64-bit timestamps in the kernel and is generally not necessary.

    This replaces the conversion with a simple cast to time64_t that shows
    what is going on. As the orangefs-internal representation already uses
    64-bit timestamps, there should be no ambiguity to negative values,
    and the cast ensures that we treat them as times before 1970 on both
    32-bit and 64-bit architectures, rather than times after 2038. This
    patch keeps that behavior.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Mike Marshall

    Arnd Bergmann
     

20 Feb, 2016

3 commits


05 Feb, 2016

1 commit


29 Jan, 2016

2 commits


24 Jan, 2016

3 commits

  • fold orangefs_op_initialize() in there, don't bother locking something
    nobody else could've seen yet, use kmem_cache_zalloc() instead of
    explicit memset()...

    Signed-off-by: Al Viro
    Signed-off-by: Mike Marshall

    Al Viro
     
  • Signed-off-by: Al Viro
    Signed-off-by: Mike Marshall

    Al Viro
     
  • * create with refcount 1
    * make op_release() decrement and free if zero (i.e. old put_op()
    has become that).
    * mark when submitter has given up waiting; from that point nobody
    else can move between the lists, change state, etc.
    * have daemon read/write_iter grab a reference when picking op
    and *always* give it up in the end
    * don't put into hash until we know it's been successfully passed to
    daemon

    * move op->lock _lower_ than htab_in_progress_lock (and make sure
    to take it in purge_inprogress_ops())

    Signed-off-by: Al Viro
    Signed-off-by: Mike Marshall

    Al Viro
     

05 Jan, 2016

1 commit


05 Dec, 2015

1 commit