06 Jul, 2017

1 commit

  • btrfs, debugfs, reiserfs and tracefs call save_mount_options() and reiserfs
    calls replace_mount_options(), but they then implement their own
    ->show_options() methods and don't touch s_options, rendering the saved
    options unnecessary. I'm trying to eliminate s_options to make it easier
    to implement a context-based mount where the mount options can be passed
    individually over a file descriptor.

    Remove the calls to save/replace_mount_options() call in these cases.

    Signed-off-by: David Howells
    cc: Chris Mason
    cc: Greg Kroah-Hartman
    cc: Steven Rostedt
    cc: linux-btrfs@vger.kernel.org
    cc: reiserfs-devel@vger.kernel.org
    Signed-off-by: Al Viro

    David Howells
     

27 Apr, 2017

1 commit

  • simple_fill_super() is passed an array of tree_descr structures which
    describe the files to create in the filesystem's root directory. Since
    these arrays are never modified intentionally, they should be 'const' so
    that they are placed in .rodata and benefit from memory protection.
    This patch updates the function signature and all users, and also
    constifies tree_descr.name.

    Signed-off-by: Eric Biggers
    Signed-off-by: Al Viro

    Eric Biggers
     

28 Sep, 2016

1 commit

  • CURRENT_TIME macro is not appropriate for filesystems as it
    doesn't use the right granularity for filesystem timestamps.
    Use current_time() instead.

    CURRENT_TIME is also not y2038 safe.

    This is also in preparation for the patch that transitions
    vfs timestamps to use 64 bit time and hence make them
    y2038 safe. As part of the effort current_time() will be
    extended to do range checks. Hence, it is necessary for all
    file system timestamps to use current_time(). Also,
    current_time() will be transitioned along with vfs to be
    y2038 safe.

    Note that whenever a single call to current_time() is used
    to change timestamps in different inodes, it is because they
    share the same time granularity.

    Signed-off-by: Deepa Dinamani
    Reviewed-by: Arnd Bergmann
    Acked-by: Felipe Balbi
    Acked-by: Steven Whitehouse
    Acked-by: Ryusuke Konishi
    Acked-by: David Sterba
    Signed-off-by: Al Viro

    Deepa Dinamani
     

30 May, 2016

1 commit


23 Jan, 2016

1 commit

  • parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
    inode_foo(inode) being mutex_foo(&inode->i_mutex).

    Please, use those for access to ->i_mutex; over the coming cycle
    ->i_mutex will become rwsem, with ->lookup() done with it held
    only shared.

    Signed-off-by: Al Viro

    Al Viro
     

05 Nov, 2015

1 commit

  • In tracefs' start_creating(), we pin the file system to safely access
    its root. When we failed to create a file, we unpin the file system via
    failed_creating() to release the mount count and eventually the reference
    of the singleton vfsmount.

    However, when we run into an error during lookup_one_len() when still
    in start_creating(), we only release the parent's mutex but not so the
    reference on the mount.

    F.e., in securityfs_create_file(), after doing simple_pin_fs() when
    lookup_one_len() fails there, we infact do simple_release_fs(). This
    seems necessary here as well.

    Same issue seen in debugfs due to 190afd81e4a5 ("debugfs: split the
    beginning and the end of __create_file() off"), which seemed to got
    carried over into tracefs, too. Noticed during code review.

    Link: http://lkml.kernel.org/r/68efa86101b778cf7517ed7c6ad573bd69f60ec6.1446672850.git.daniel@iogearbox.net

    Fixes: 4282d60689d4 ("tracefs: Add new tracefs file system")
    Cc: stable@vger.kernel.org # 4.1+
    Signed-off-by: Daniel Borkmann
    Signed-off-by: Steven Rostedt

    Daniel Borkmann
     

05 Jul, 2015

1 commit

  • Pull more vfs updates from Al Viro:
    "Assorted VFS fixes and related cleanups (IMO the most interesting in
    that part are f_path-related things and Eric's descriptor-related
    stuff). UFS regression fixes (it got broken last cycle). 9P fixes.
    fs-cache series, DAX patches, Jan's file_remove_suid() work"

    [ I'd say this is much more than "fixes and related cleanups". The
    file_table locking rule change by Eric Dumazet is a rather big and
    fundamental update even if the patch isn't huge. - Linus ]

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (49 commits)
    9p: cope with bogus responses from server in p9_client_{read,write}
    p9_client_write(): avoid double p9_free_req()
    9p: forgetting to cancel request on interrupted zero-copy RPC
    dax: bdev_direct_access() may sleep
    block: Add support for DAX reads/writes to block devices
    dax: Use copy_from_iter_nocache
    dax: Add block size note to documentation
    fs/file.c: __fget() and dup2() atomicity rules
    fs/file.c: don't acquire files->file_lock in fd_install()
    fs:super:get_anon_bdev: fix race condition could cause dev exceed its upper limitation
    vfs: avoid creation of inode number 0 in get_next_ino
    namei: make set_root_rcu() return void
    make simple_positive() public
    ufs: use dir_pages instead of ufs_dir_pages()
    pagemap.h: move dir_pages() over there
    remove the pointless include of lglock.h
    fs: cleanup slight list_entry abuse
    xfs: Correctly lock inode when removing suid and file capabilities
    fs: Call security_ops->inode_killpriv on truncate
    fs: Provide function telling whether file_remove_privs() will do anything
    ...

    Linus Torvalds
     

01 Jul, 2015

1 commit

  • This allows for better documentation in the code and
    it allows for a simpler and fully correct version of
    fs_fully_visible to be written.

    The mount points converted and their filesystems are:
    /sys/hypervisor/s390/ s390_hypfs
    /sys/kernel/config/ configfs
    /sys/kernel/debug/ debugfs
    /sys/firmware/efi/efivars/ efivarfs
    /sys/fs/fuse/connections/ fusectl
    /sys/fs/pstore/ pstore
    /sys/kernel/tracing/ tracefs
    /sys/fs/cgroup/ cgroup
    /sys/kernel/security/ securityfs
    /sys/fs/selinux/ selinuxfs
    /sys/fs/smackfs/ smackfs

    Cc: stable@vger.kernel.org
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

24 Jun, 2015

1 commit


04 Feb, 2015

3 commits

  • The tracing "instances" directory can create sub tracing buffers
    with mkdir, and remove them with rmdir. As a mkdir will also create
    all the files and directories that control the sub buffer the inode
    mutexes need to be released before this is done, to avoid deadlocks.
    It is better to let the tracing system unlock the inode mutexes before
    calling the functions that create the files within the new directory
    (or deletes the files from the one being destroyed).

    Now that tracing has been converted over to tracefs, the tracefs file
    system can be modified to accommodate this feature. It still releases
    the locks, but the filesystem itself can take care of the ugly
    business and let the user just do what it needs.

    The tracing system now attaches a descriptor to the directory dentry
    that can have userspace create or remove sub directories. If this
    descriptor does not exist for a dentry, then that dentry can not be
    used to create other directories. This descriptor holds a mkdir and
    rmdir method that only takes a character string as an argument.

    The tracefs file system will first make a copy of the dentry name
    before releasing the locks. Then it will pass the copied name to the
    methods. It is up to the tracing system that supplied the methods to
    handle races with duplicate names and such as all the inode mutexes
    would be released when the functions are called.

    Cc: Al Viro
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • When tracefs is configured, have the directory /sys/kernel/tracing appear
    just like /sys/kernel/debug appears when debugfs is configured.

    This will give a consistent place for system admins to mount tracefs.

    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • Add a separate file system to handle the tracing directory. Currently it
    is part of debugfs, but that is starting to show its limits.

    One thing is that in order to access the tracing infrastructure, you need
    to mount debugfs. As that includes debugging from all sorts of sub systems
    in the kernel, it is not considered advisable to mount such an all
    encompassing debugging system.

    Having the tracing system in its own file systems gives access to the
    tracing sub system without needing to include all other systems.

    Another problem with tracing using the debugfs system is that the
    instances use mkdir to create sub buffers. debugfs does not support mkdir
    from userspace so to implement it, special hacks were used. By controlling
    the file system that the tracing infrastructure uses, this can be properly
    done without hacks.

    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)