1. 06 3月, 2019 3 次提交
  2. 03 8月, 2018 3 次提交
  3. 05 6月, 2018 1 次提交
  4. 02 4月, 2018 6 次提交
  5. 26 2月, 2018 1 次提交
  6. 23 2月, 2018 1 次提交
  7. 30 1月, 2018 6 次提交
  8. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      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 <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  9. 07 9月, 2017 1 次提交
  10. 17 7月, 2017 1 次提交
    • Y
      ceph: fix race in concurrent readdir · 84583cfb
      Yan, Zheng 提交于
      For a large directory, program needs to issue multiple readdir
      syscalls to get all dentries. When there are multiple programs
      read the directory concurrently. Following sequence of events
      can happen.
      
       - program calls readdir with pos = 2. ceph sends readdir request
         to mds. The reply contains N1 entries. ceph adds these N1 entries
         to readdir cache.
       - program calls readdir with pos = N1+2. The readdir is satisfied
         by the readdir cache, N2 entries are returned. (Other program
         calls readdir in the middle, which fills the cache)
       - program calls readdir with pos = N1+N2+2. ceph sends readdir
         request to mds. The reply contains N3 entries and it reaches
         directory end. ceph adds these N3 entries to the readdir cache
         and marks directory complete.
      
      The second readdir call does not update fi->readdir_cache_idx.
      ceph add the last N3 entries to wrong places.
      
      Cc: stable@vger.kernel.org # v4.3+
      Signed-off-by: N"Yan, Zheng" <zyan@redhat.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      84583cfb
  11. 04 5月, 2017 2 次提交
    • Y
      ceph: choose readdir frag based on previous readdir reply · b50c2de5
      Yan, Zheng 提交于
      The dirfragtree is lazily updated, it's not always accurate. Infinite
      loops happens in following circumstance.
      
      - client send request to read frag A
      - frag A has been fragmented into frag B and C. So mds fills the reply
        with contents of frag B
      - client wants to read next frag C. ceph_choose_frag(frag value of C)
        return frag A.
      
      The fix is using previous readdir reply to calculate next readdir frag
      when possible.
      Signed-off-by: N"Yan, Zheng" <zyan@redhat.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      b50c2de5
    • Y
      ceph: make seeky readdir more efficient · 79162547
      Yan, Zheng 提交于
      Current cephfs client uses string to indicate start position of
      readdir. The string is last entry of previous readdir reply.
      This approach does not work for seeky readdir because we can
      not easily convert the new postion to a string. For seeky readdir,
      mds needs to return dentries from the beginning. Client keeps
      retrying if the reply does not contain the dentry it wants.
      
      In current version of ceph, mds sorts CDentry in its cache in
      hash order. Client also uses dentry hash to compose dir postion.
      For seeky readdir, if client passes the hash part of dir postion
      to mds. mds can avoid replying useless dentries.
      Signed-off-by: N"Yan, Zheng" <zyan@redhat.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      79162547
  12. 20 2月, 2017 4 次提交
  13. 19 1月, 2017 1 次提交
  14. 08 12月, 2016 1 次提交
    • J
      ceph: don't set req->r_locked_dir in ceph_d_revalidate · c3f4688a
      Jeff Layton 提交于
      This function sets req->r_locked_dir which is supposed to indicate to
      ceph_fill_trace that the parent's i_rwsem is locked for write.
      Unfortunately, there is no guarantee that the dir will be locked when
      d_revalidate is called, so we really don't want ceph_fill_trace to do
      any dcache manipulation from this context. Clear req->r_locked_dir since
      it's clearly not safe to do that.
      
      What we really want to know with d_revalidate is whether the dentry
      still points to the same inode. ceph_fill_trace installs a pointer to
      the inode in req->r_target_inode, so we can just compare that to
      d_inode(dentry) to see if it's the same one after the lookup.
      
      Also, since we aren't generally interested in the parent here, we can
      switch to using a GETATTR to hint that to the MDS, which also means that
      we only need to reserve one cap.
      
      Finally, just remove the d_unhashed check. That's really outside the
      purview of a filesystem's d_revalidate. If the thing became unhashed
      while we're checking it, then that's up to the VFS to handle anyway.
      
      Fixes: 200fd27c ("ceph: use lookup request to revalidate dentry")
      Link: http://tracker.ceph.com/issues/18041Reported-by: NDonatas Abraitis <donatas.abraitis@gmail.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: N"Yan, Zheng" <zyan@redhat.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      c3f4688a
  15. 29 10月, 2016 2 次提交
  16. 08 10月, 2016 1 次提交
  17. 27 9月, 2016 2 次提交
    • M
      fs: rename "rename2" i_op to "rename" · 2773bf00
      Miklos Szeredi 提交于
      Generated patch:
      
      sed -i "s/\.rename2\t/\.rename\t\t/" `git grep -wl rename2`
      sed -i "s/\brename2\b/rename/g" `git grep -wl rename2`
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      2773bf00
    • M
      fs: make remaining filesystems use .rename2 · 1cd66c93
      Miklos Szeredi 提交于
      This is trivial to do:
      
       - add flags argument to foo_rename()
       - check if flags is zero
       - assign foo_rename() to .rename2 instead of .rename
      
      This doesn't mean it's impossible to support RENAME_NOREPLACE for these
      filesystems, but it is not trivial, like for local filesystems.
      RENAME_NOREPLACE must guarantee atomicity (i.e. it shouldn't be possible
      for a file to be created on one host while it is overwritten by rename on
      another host).
      
      Filesystems converted:
      
      9p, afs, ceph, coda, ecryptfs, kernfs, lustre, ncpfs, nfs, ocfs2, orangefs.
      
      After this, we can get rid of the duplicate interfaces for rename.
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: David Howells <dhowells@redhat.com> [AFS]
      Acked-by: NMike Marshall <hubcap@omnibond.com>
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Ilya Dryomov <idryomov@gmail.com>
      Cc: Jan Harkes <jaharkes@cs.cmu.edu>
      Cc: Tyler Hicks <tyhicks@canonical.com>
      Cc: Oleg Drokin <oleg.drokin@intel.com>
      Cc: Trond Myklebust <trond.myklebust@primarydata.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      1cd66c93
  18. 05 9月, 2016 1 次提交
    • N
      ceph: do not modify fi->frag in need_reset_readdir() · 0f5aa88a
      Nicolas Iooss 提交于
      Commit f3c4ebe6 ("ceph: using hash value to compose dentry offset")
      modified "if (fpos_frag(new_pos) != fi->frag)" to "if (fi->frag |=
      fpos_frag(new_pos))" in need_reset_readdir(), thus replacing a
      comparison operator with an assignment one.
      
      This looks like a typo which is reported by clang when building the
      kernel with some warning flags:
      
          fs/ceph/dir.c:600:22: error: using the result of an assignment as a
          condition without parentheses [-Werror,-Wparentheses]
                  } else if (fi->frag |= fpos_frag(new_pos)) {
                             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
          fs/ceph/dir.c:600:22: note: place parentheses around the assignment
          to silence this warning
                  } else if (fi->frag |= fpos_frag(new_pos)) {
                                      ^
                             (                             )
          fs/ceph/dir.c:600:22: note: use '!=' to turn this compound
          assignment into an inequality comparison
                  } else if (fi->frag |= fpos_frag(new_pos)) {
                                      ^~
                                      !=
      
      Fixes: f3c4ebe6 ("ceph: using hash value to compose dentry offset")
      Signed-off-by: NNicolas Iooss <nicolas.iooss_linux@m4x.org>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      0f5aa88a
  19. 28 7月, 2016 2 次提交