04 Jul, 2019

2 commits

  • Use the pid of lockd instead of the remote lock's svid for the fl_pid for
    local POSIX locks. This allows proper enumeration of which local process
    owns which lock. The svid is meaningless to local lock readers.

    Signed-off-by: Benjamin Coddington
    Signed-off-by: J. Bruce Fields

    Benjamin Coddington
     
  • Do as the NLM client: allocate and track a struct nlm_lockowner for use as
    the fl_owner for locks created by the NLM sever. This allows us to keep
    the svid within this structure for matching locks, and will allow us to
    track the pid of lockd in a future patch. It should also allow easier
    reference of the nlm_host in conflicting locks, and simplify lock hashing
    and comparison.

    Signed-off-by: Benjamin Coddington
    [bfields@redhat.com: fix type of some error returns]
    Signed-off-by: J. Bruce Fields

    Benjamin Coddington
     

31 May, 2019

1 commit

  • This reverts most of commit b8eee0e90f97 ("lockd: Show pid of lockd for
    remote locks"), which caused remote locks to not be differentiated between
    remote processes for NLM.

    We retain the fixup for setting the client's fl_pid to a negative value.

    Fixes: b8eee0e90f97 ("lockd: Show pid of lockd for remote locks")
    Cc: stable@vger.kernel.org

    Signed-off-by: Benjamin Coddington
    Reviewed-by: XueWei Zhang
    Signed-off-by: J. Bruce Fields

    Benjamin Coddington
     

15 Dec, 2018

1 commit

  • Commit 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific l_pid
    for remote locks") specified that the l_pid returned for F_GETLK on a local
    file that has a remote lock should be the pid of the lock manager process.
    That commit, while updating other filesystems, failed to update lockd, such
    that locks created by lockd had their fl_pid set to that of the remote
    process holding the lock. Fix that here to be the pid of lockd.

    Also, fix the client case so that the returned lock pid is negative, which
    indicates a remote lock on a remote file.

    Fixes: 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific...")
    Cc: stable@vger.kernel.org

    Signed-off-by: Benjamin Coddington
    Signed-off-by: J. Bruce Fields

    Benjamin Coddington
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

15 May, 2017

2 commits


17 Dec, 2010

1 commit

  • We'd like to prevent local buffer overflows caused by malicious or
    broken servers. New xdr_stream style decoders can do that.

    For efficiency, we also want to be able to pass xdr_streams from
    call_encode() to all XDR encoding functions, rather than building
    an xdr_stream in every XDR encoding function in the kernel.

    Same idea as the NLM v3 XDR overhaul.

    Signed-off-by: Chuck Lever
    Tested-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

24 Sep, 2009

1 commit

  • * remove asm/atomic.h inclusion from linux/utsname.h --
    not needed after kref conversion
    * remove linux/utsname.h inclusion from files which do not need it

    NOTE: it looks like fs/binfmt_elf.c do not need utsname.h, however
    due to some personality stuff it _is_ needed -- cowardly leave ELF-related
    headers and files alone.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

07 Jan, 2009

2 commits

  • Clean up: The include/linux/lockd/sm_inter.h header is nearly empty
    now. Remove it.

    Signed-off-by: Chuck Lever
    Signed-off-by: J. Bruce Fields

    Chuck Lever
     
  • The NLM XDR decoders for the NLMPROC_SM_NOTIFY procedure should treat
    their "priv" argument truly as an opaque, as defined by the protocol,
    and let the upper layers figure out what is in it.

    This will make it easier to modify the contents and interpretation of
    the "priv" argument, and keep knowledge about what's in "priv" local
    to fs/lockd/mon.c.

    For now, the NLM and NSM implementations should behave exactly as they
    did before.

    The formation of the address of the rebooted host in
    nlm_host_rebooted() may look a little strange, but it is the inverse
    of how nsm_init_private() forms the private cookie. Plus, it's
    going away soon anyway.

    Signed-off-by: Chuck Lever
    Signed-off-by: J. Bruce Fields

    Chuck Lever
     

04 Oct, 2008

1 commit

  • The nlm_reboot structure is used to store information provided by the
    NSM_NOTIFY procedure. This procedure is not specified by the NLM or NSM
    protocols, other than to say that the procedure can be used to transmit
    information private to a particular NLM/NSM implementation.

    For Linux, the callback arguments include the name of the monitored host,
    the new NSM state of the host, and a 16-byte private opaque.

    As a clean up, remove the unused fields and the server-side XDR logic that
    decodes them.

    Signed-off-by: Chuck Lever
    Signed-off-by: J. Bruce Fields

    Chuck Lever
     

10 Oct, 2007

1 commit


15 May, 2007

1 commit

  • - fs/lockd/xdr4.c:140:27: warning: incorrect type in argument 2 (different
    explicit signedness)
    - fs/lockd/xdr4.c:141:27: warning: incorrect type in argument 2 (different
    explicit signedness)
    - fs/lockd/xdr4.c:432:28: warning: incorrect type in argument 2 (different
    explicit signedness)
    - fs/lockd/xdr4.c:433:28: warning: incorrect type in argument 2 (different
    explicit signedness)
    - fs/lockd/xdr4.c:587:20: warning: symbol 'nlm_version4' was not declared.
    Should it be static?

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

01 May, 2007

2 commits

  • The RPC buffer size estimation logic in net/sunrpc/clnt.c always
    significantly overestimates the requirements for the buffer size.
    A little instrumentation demonstrated that in fact rpc_malloc was never
    allocating the buffer from the mempool, but almost always called kmalloc.

    To compute the size of the RPC buffer more precisely, split p_bufsiz into
    two fields; one for the argument size, and one for the result size.

    Then, compute the sum of the exact call and reply header sizes, and split
    the RPC buffer precisely between the two. That should keep almost all RPC
    buffers within the 2KiB buffer mempool limit.

    And, we can finally be rid of RPC_SLACK_SPACE!

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • NLM version 4 requests estimate the call and reply header sizes rather
    conservatively, using the very maximum size allowed in the protocol even
    though Linux always uses only a small fraction of the allowable space.

    Reduce the size of caller and lock arguments to conserve RPC buffer space
    while XDR encoding NLM4 arguments. Add compile-time checks to ensure the
    hostname string won't overflow NLM protocol maximums.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

14 Dec, 2006

1 commit


21 Oct, 2006

1 commit


21 Mar, 2006

2 commits


07 Jan, 2006

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds