06 Jan, 2012

1 commit

  • Reduce object size by deduplicating formats.

    Use vsprintf extension %pV.
    Rename P9_DPRINTK uses to p9_debug, align arguments.
    Add function for _p9_debug and macro to add __func__.
    Add missing "\n"s to p9_debug uses.
    Remove embedded function names as p9_debug adds it.
    Remove P9_EPRINTK macro and convert use to pr_.
    Add and use pr_fmt and pr_.

    $ size fs/9p/built-in.o*
    text data bss dec hex filename
    62133 984 16000 79117 1350d fs/9p/built-in.o.new
    67342 984 16928 85254 14d06 fs/9p/built-in.o.old
    $ size net/9p/built-in.o*
    text data bss dec hex filename
    88792 4148 22024 114964 1c114 net/9p/built-in.o.new
    94072 4148 23232 121452 1da6c net/9p/built-in.o.old

    Signed-off-by: Joe Perches
    Signed-off-by: Eric Van Hensbergen

    Joe Perches
     

25 Oct, 2011

1 commit


23 Jul, 2011

2 commits

  • Without this fix, if any invalid mount options/args are passed while mouting
    the 9p fs, no error (-EINVAL) is returned and default arg value is assigned.

    This fix returns -EINVAL when an invalid arguement is found while parsing
    mount options.

    Signed-off-by: Prem Karat
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Prem Karat
     
  • This make sure we don't use wrong inode from the inode hash. The inode number
    of the file deleted is reused by the next file system object created
    and if we only use inode number for inode hash lookup we could end up
    with wrong struct inode.

    Also compare inode generation number. Not all Linux file system provide
    st_gen in userspace. So it could be 0;

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     

15 Mar, 2011

4 commits

  • Switch to the fscache code to v9fs_inode. We will later use
    v9fs_inode in cache=loose mode to track the inode cache
    validity timeout. Ie if we find an inode in cache older
    that a specific jiffie range we will consider it stale

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • Current code sets access=user as default for all protocol versions.
    This patch chagnes it to "client" only for dotl.

    User can always specify particular access mode with -o access= option.
    No change there.

    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     
  • The mount option access=client is overloaded as it assumes acl too.
    Adding posixacl option to enable POSIX ACLs makes it explicit and clear.
    Also it is convenient in the future to add other types of acls like richacls.

    Ideally, the access mode 'client' should be just like V9FS_ACCESS_USER
    except it underscores the location of access check.
    Traditional 9P protocol lets the server perform access checks but with
    this mode, all the access checks will be performed on the client itself.
    Server just follows the client's directive.

    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     
  • If the kernel is not compiled with CONFIG_9P_FS_POSIX_ACL and the
    mount option is specified to enable ACLs current code fails the mount.
    This patch brings the behavior inline with other filesystems like ext3
    by proceeding with the mount and log a warning to syslog.

    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     

28 Oct, 2010

1 commit


03 Aug, 2010

2 commits

  • During fid lookup we need to make sure that the dentry->d_parent doesn't
    change so that we can safely walk the parent dentries. To ensure that
    we need to prevent cross directory rename during fid_lookup. Add a
    per superblock rename_sem rw_semaphore to prevent parallel fid lookup and
    rename.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • We need to make sure we pass the right uid value
    during attach. dotl is similar to dotu in this regard.
    Without this mapped security model on dotl doesn't work

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     

22 Apr, 2010

1 commit


06 Apr, 2010

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
    9p: saving negative to unsigned char
    9p: return on mutex_lock_interruptible()
    9p: Creating files with names too long should fail with ENAMETOOLONG.
    9p: Make sure we are able to clunk the cached fid on umount
    9p: drop nlink remove
    fs/9p: Clunk the fid resulting from partial walk of the name
    9p: documentation update
    9p: Fix setting of protocol flags in v9fs_session_info structure.

    Linus Torvalds
     

05 Apr, 2010

2 commits


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

06 Mar, 2010

2 commits


09 Feb, 2010

2 commits


24 Sep, 2009

1 commit

  • This patch adds a persistent, read-only caching facility for
    9p clients using the FS-Cache caching backend.

    When the fscache facility is enabled, each inode is associated
    with a corresponding vcookie which is an index into the FS-Cache
    indexing tree. The FS-Cache indexing tree is indexed at 3 levels:
    - session object associated with each mount.
    - inode/vcookie
    - actual data (pages)

    A cache tag is chosen randomly for each session. These tags can
    be read off /sys/fs/9p/caches and can be passed as a mount-time
    parameter to re-attach to the specified caching session.

    Signed-off-by: Abhishek Kulkarni
    Signed-off-by: Eric Van Hensbergen

    Abhishek Kulkarni
     

18 Aug, 2009

1 commit


20 Dec, 2008

1 commit

  • Since v9ses->uid is unsigned, it would seem better to use simple_strtoul that
    simple_strtol.

    A simplified version of the semantic patch that makes this change is as
    follows: (http://www.emn.fr/x-info/coccinelle/)

    //
    @r2@
    long e;
    position p;
    @@

    e = simple_strtol@p(...)

    @@
    position p != r2.p;
    type T;
    T e;
    @@

    e =
    - simple_strtol@p
    + simple_strtoul
    (...)
    //

    Signed-off-by: Julia Lawall
    Acked-by: Eric Van Hensbergen

    Julia Lawall
     

18 Oct, 2008

2 commits

  • There are a couple of methods in the client code which aren't actually
    wire operations. To keep things organized cleaner, these operations are
    being moved to the fs layer.

    This patch moves the readn meta-function (which executes multiple wire
    reads until a buffer is full) to the fs layer.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • Right now there is a transport module structure which provides per-transport
    type functions and data and a transport structure which contains per-instance
    public data as well as function pointers to instance specific functions.

    This patch moves public transport visible instance data to the client
    structure (which in some cases had duplicate data) and consolidates the
    functions into the transport module structure.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     

14 Oct, 2008

1 commit

  • This is a much better version of a previous patch to make the parser
    tables constant. Rather than changing the typedef, we put the "const" in
    all the various places where its required, allowing the __initconst
    exception for nfsroot which was the cause of the previous trouble.

    This was posted for review some time ago and I believe its been in -mm
    since then.

    Signed-off-by: Steven Whitehouse
    Cc: Alexander Viro
    Signed-off-by: Linus Torvalds

    Steven Whitehouse
     

15 May, 2008

4 commits

  • There was some cleanup issues during early mount which would trigger
    a kernel bug for certain types of failure. This patch reorganizes the
    cleanup to get rid of the bad behavior.

    This also merges the 9pnet and 9pnet_fd modules for the purpose of
    configuration and initialization. Keeping the fd transport separate
    from the core 9pnet code seemed like a good idea at the time, but in
    practice has caused more harm and confusion than good.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • …that this function can fail, return an int, diagnose other option-parsing failures, and adjust the sole caller: (v9fs_session_init): Handle kstrdup failure. Propagate any new v9fs_parse_options failure "up".

    Signed-off-by: Jim Meyering <meyering@redhat.com>
    Cc: Ron Minnich <rminnich@sandia.gov>
    Cc: Latchesar Ionkov <lucho@ionkov.net>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Acked-by: Eric Van Hensbergen <ericvh@gmail.com>

    Jim Meyering
     
  • The kernel-doc comments of much of the 9p system have been in disarray since
    reorganization. This patch fixes those problems, adds additional documentation
    and a template book which collects the 9p information.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • match_strcpy() is a somewhat creepy function: the caller needs to make sure
    that the destination buffer is big enough, and when he screws up or
    forgets, match_strcpy() happily overruns the buffer.

    There's exactly one customer: v9fs_parse_options(). I believe it currently
    can't overflow its buffer, but that's not exactly obvious.

    The source string is a substing of the mount options. The kernel silently
    truncates those to PAGE_SIZE bytes, including the terminating zero. See
    compat_sys_mount() and do_mount().

    The destination buffer is obtained from __getname(), which allocates from
    name_cachep, which is initialized by vfs_caches_init() for size PATH_MAX.

    We're safe as long as PATH_MAX
    Cc: Latchesar Ionkov
    Cc: Jim Meyering
    Cc: "Randy.Dunlap"
    Signed-off-by: Andrew Morton
    Signed-off-by: Eric Van Hensbergen

    Markus Armbruster
     

07 Feb, 2008

1 commit

  • This merges the mux.c (including the connection interface) with trans_fd
    in preparation for transport API changes. Ultimately, trans_fd will need
    to be rewritten to clean it up and simplify the implementation, but this
    reorganization is viewed as the first step.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     

06 Nov, 2007

1 commit

  • v9fs_parse_options function uses strsep which modifies the value of the
    v9ses->options field. That modified value is later passed to the function
    that creates the transport potentially making the transport creation
    function to fail.

    This patch creates a copy of v9ses->option field that v9fs_parse_options
    function uses instead of the original value.

    Signed-off-by: Latchesar Ionkov
    Acked-by: Eric Van Hensbergen

    Latchesar Ionkov
     

24 Oct, 2007

1 commit


18 Oct, 2007

5 commits

  • This patch moves transport dynamic registration and matching to the net
    module to prevent a bad Kconfig dependency between the net and fs 9p modules.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • The 9P2000 protocol requires the authentication and permission checks to be
    done in the file server. For that reason every user that accesses the file
    server tree has to authenticate and attach to the server separately.
    Multiple users can share the same connection to the server.

    Currently v9fs does a single attach and executes all I/O operations as a
    single user. This makes using v9fs in multiuser environment unsafe as it
    depends on the client doing the permission checking.

    This patch improves the 9P2000 support by allowing every user to attach
    separately. The patch defines three modes of access (new mount option
    'access'):

    - attach-per-user (access=user) (default mode for 9P2000.u)
    If a user tries to access a file served by v9fs for the first time, v9fs
    sends an attach command to the server (Tattach) specifying the user. If
    the attach succeeds, the user can access the v9fs tree.
    As there is no uname->uid (string->integer) mapping yet, this mode works
    only with the 9P2000.u dialect.

    - allow only one user to access the tree (access=)
    Only the user with uid can access the v9fs tree. Other users that attempt
    to access it will get EPERM error.

    - do all operations as a single user (access=any) (default for 9P2000)
    V9fs does a single attach and all operations are done as a single user.
    If this mode is selected, the v9fs behavior is identical with the current
    one.

    Signed-off-by: Latchesar Ionkov
    Signed-off-by: Eric Van Hensbergen

    Latchesar Ionkov
     
  • Change the names of 'uid' and 'gid' parameters to the more appropriate
    'dfltuid' and 'dfltgid'. This also sets the default uid/gid to -2
    (aka nfsnobody)

    Signed-off-by: Latchesar Ionkov
    Signed-off-by: Eric Van Hensbergen

    Latchesar Ionkov
     
  • Create more general flags field in the v9fs_session_info struct and move the
    'extended' flag as a bit in the flags.

    Signed-off-by: Latchesar Ionkov
    Signed-off-by: Eric Van Hensbergen

    Latchesar Ionkov
     
  • This patch abstracts out the interfaces to underlying transports so that
    new transports can be added as modules. This should also allow kernel
    configuration of transports without ifdef-hell.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     

17 Jul, 2007

1 commit


15 Jul, 2007

1 commit

  • During reorganization, the mount time debug option was removed in favor
    of module-load-time parameters. However, the mount time option is still
    a useful for feature during debug and for user-fault isolation when the
    module is compiled into the kernel.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen