1. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      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
      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: 's avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: 's avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: 's avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  2. 07 Dec, 2015 1 commit
    • Al Viro's avatar
      ufs: get rid of ->setattr() for symlinks · 9cdce3c0
      Al Viro authored
      It was to needed for a couple of months in 2010, until UFS
      quota support got dropped.  Since then it's equivalent to
      simple_setattr() (i.e. the default) for everything except the
      regular files.  And dropping it there allows to convert all
      UFS symlinks to {page,simple}_symlink_inode_operations, getting
      rid of fs/ufs/symlink.c completely.
      Signed-off-by: 's avatarAl Viro <viro@zeniv.linux.org.uk>
  3. 06 Jul, 2015 4 commits
    • Al Viro's avatar
      ufs: move truncate code into inode.c · 010d331f
      Al Viro authored
      It is closely tied to block pointers handling there, can benefit
      from existing helpers, etc. - no point keeping them apart.
      Trimmed the trailing whitespaces in inode.c at the same time.
      Signed-off-by: 's avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
      ufs: kill lock_ufs() · dff7cfd3
      Al Viro authored
      There were 3 remaining users; in two of them we took ->s_lock immediately
      after lock_ufs() and held it until just before unlock_ufs(); the third
      one (statfs) could not be called from itself or from other two (remount
      and sync_fs).  Just use ->s_lock in statfs and don't bother with lock_ufs
      at all.
      Signed-off-by: 's avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
      ufs: don't use lock_ufs() for block pointers tree protection · 724bb09f
      Al Viro authored
      * stores to block pointers are under per-inode seqlock (meta_lock) and
      mutex (truncate_mutex)
      * fetches of block pointers are either under truncate_mutex, or wrapped
      into seqretry loop on meta_lock
      * all changes of ->i_size are under truncate_mutex and i_mutex
      * all changes of ->i_lastfrag are under truncate_mutex
      It's similar to what ext2 is doing; the main difference is that unlike
      ext2 we can't rely upon the atomicity of stores into block pointers -
      on UFS2 they are 64bit.  So we can't cut the corner when switching
      a pointer from NULL to non-NULL as we could in ext2_splice_branch()
      and need to use meta_lock on all modifications.
      We use seqlock where ext2 uses rwlock; ext2 could probably also benefit
      from such change...
      Another non-trivial difference is that with UFS we *cannot* have reader
      grab truncate_mutex in case of race - it has to keep retrying.  That
      might be possible to change, but not until we lift tail unpacking
      several levels up in call chain.
      After that commit we do *NOT* hold fs-wide serialization on accesses
      to block pointers anymore.  Moreover, lock_ufs() can become a normal
      mutex now - it's only used on statfs, remount and sync_fs and none
      of those uses are recursive.  As the matter of fact, *now* it can be
      collapsed with ->s_lock, and be eventually replaced with saner
      per-cylinder-group spinlocks, but that's a separate story.
      Signed-off-by: 's avatarAl Viro <viro@zeniv.linux.org.uk>
    • Al Viro's avatar
  4. 16 Jun, 2015 2 commits
  5. 08 Aug, 2014 2 commits
  6. 06 Jun, 2014 1 commit
    • Fabian Frederick's avatar
      ufs: sb mutex merge + mutex_destroy · 0244756e
      Fabian Frederick authored
      Commit 788257d6 ("ufs: remove the BKL") replaced BKL with mutex
      protection using functions lock_ufs, unlock_ufs and struct mutex 'mutex'
      in sb_info.
      Commit b6963327 ("ufs: drop lock/unlock super") removed lock/unlock
      super and added struct mutex 's_lock' in sb_info.
      Those 2 mutexes are generally locked/unlocked at the same time except in
      allocation (balloc, ialloc).
      This patch merges the 2 mutexes and propagates first commit solution.
      It also adds mutex destruction before kfree during ufs_fill_super
      failure and ufs_put_super.
      [akpm@linux-foundation.org: avoid ifdefs, return -EROFS not -EINVAL]
      Signed-off-by: 's avatarFabian Frederick <fabf@skynet.be>
      Cc: Evgeniy Dushistov <dushistov@mail.ru>
      Cc: "Chen, Jet" <jet.chen@intel.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
  7. 10 Oct, 2012 1 commit
  8. 22 Jul, 2012 1 commit
    • Artem Bityutskiy's avatar
      fs/ufs: get rid of write_super · 9e9ad5f4
      Artem Bityutskiy authored
      This patch makes UFS stop using the VFS '->write_super()' method along with
      the 's_dirt' superblock flag, because they are on their way out.
      The way we implement this is that we schedule a delay job instead relying on
      's_dirt' and '->write_super()'.
      The whole "superblock write-out" VFS infrastructure is served by the
      'sync_supers()' kernel thread, which wakes up every 5 (by default) seconds and
      writes out all dirty superblocks using the '->write_super()' call-back.  But the
      problem with this thread is that it wastes power by waking up the system every
      5 seconds, even if there are no diry superblocks, or there are no client
      file-systems which would need this (e.g., btrfs does not use
      '->write_super()'). So we want to kill it completely and thus, we need to make
      file-systems to stop using the '->write_super()' VFS service, and then remove
      it together with the kernel thread.
      Tested using fsstress from the LTP project.
      Signed-off-by: 's avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: 's avatarAl Viro <viro@zeniv.linux.org.uk>
  9. 04 Jan, 2012 1 commit
  10. 01 Nov, 2011 1 commit
  11. 02 Mar, 2011 1 commit
    • Arnd Bergmann's avatar
      ufs: remove the BKL · 788257d6
      Arnd Bergmann authored
      This introduces a new per-superblock mutex in UFS to replace
      the big kernel lock. I have been careful to avoid nested
      calls to lock_ufs and to get the lock order right with
      respect to other mutexes, in particular lock_super.
      I did not make any attempt to prove that the big kernel
      lock is not needed in a particular place in the code,
      which is very possible.
      The mutex has a significant performance impact, so it is only
      used on SMP or PREEMPT configurations.
      As Nick Piggin noticed, any allocation inside of the lock
      may end up deadlocking when we get to ufs_getfrag_block
      in the reclaim task, so we now use GFP_NOFS.
      Signed-off-by: 's avatarArnd Bergmann <arnd@arndb.de>
      Tested-by: 's avatarNick Bowler <nbowler@elliptictech.com>
      Cc: Evgeniy Dushistov <dushistov@mail.ru>
      Cc: Nick Piggin <npiggin@gmail.com>
  12. 09 Aug, 2010 1 commit
  13. 21 May, 2010 1 commit
  14. 05 Mar, 2010 1 commit
  15. 03 Mar, 2010 1 commit
  16. 16 Dec, 2009 1 commit
  17. 12 Jun, 2009 1 commit
  18. 09 May, 2009 1 commit
  19. 27 Mar, 2009 1 commit
    • Duane Griffin's avatar
      ufs: don't truncate longer ufs2 fast symlinks · f33219b7
      Duane Griffin authored
      ufs2 fast symlinks can be twice as long as ufs ones, however the code
      was using the ufs size in various places. Fix that so ufs2 symlinks over
      60 characters aren't truncated.
      Note that we copy the entire area instead of using the maxsymlinklen field
      from the superblock. This way we will be more robust against corruption (of
      the superblock).
      While we are at it, use memcpy instead of open-coding it with for loops.
      Signed-off-by: 's avatarDuane Griffin <duaneg@dghda.com>
      Signed-off-by: 's avatarAl Viro <viro@zeniv.linux.org.uk>
  20. 13 May, 2008 1 commit
  21. 28 Apr, 2008 1 commit
  22. 07 Feb, 2008 1 commit
  23. 17 Oct, 2007 1 commit