1. 19 1月, 2018 5 次提交
  2. 17 1月, 2018 9 次提交
  3. 22 12月, 2017 2 次提交
    • A
      gfs2: Trim the ordered write list in gfs2_ordered_write() · 1f23bc78
      Abhi Das 提交于
      We iterate through the entire ordered writes list in
      gfs2_ordered_write() to write out inodes. It's a good
      place to try and shrink the list by throwing out inodes
      that don't have any pages.
      Signed-off-by: NAbhi Das <adas@redhat.com>
      Acked-by: NSteven Whitehouse <swhiteho@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      1f23bc78
    • B
      GFS2: Reduce code redundancy writing log headers · 588bff95
      Bob Peterson 提交于
      Before this patch, there was a lot of code redundancy between functions
      log_write_header (which uses bio) and clean_journal (which uses
      buffer_head). This patch reduces the redundancy to simplify the code
      and make log header writing more consistent. We want more consistency
      and reduced redundancy because we plan to add a bunch of new fields
      to improve performance (by eliminating the local statfs and quota files)
      improve metadata integrity (by adding new crcs and such) and for better
      debugging (by adding new fields to track when and where metadata was
      pushed through the journals.) We don't want to duplicate setting these
      new fields, nor allow for human error in the process.
      
      This reduction in code redundancy is accomplished by introducing a new
      helper function, gfs2_write_log_header which uses bio rather than bh.
      That simplifies recovery function clean_journal() to use the new helper
      function and iomap rather than redundancy and block_map (and eventually
      we can maybe remove block_map). It also reduces our dependency on
      buffer_heads.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      588bff95
  4. 13 12月, 2017 3 次提交
    • A
      gfs2: Add a crc field to resource group headers · 850d2d91
      Andrew Price 提交于
      Add the rg_crc field to store a crc32 of the gfs2_rgrp structure. This
      allows us to check resource group headers' integrity and removes the
      requirement to check them against the rindex entries in fsck. If this
      field is found to be zero, it should be ignored (or updated with an
      accurate value).
      Signed-off-by: NAndrew Price <anprice@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      850d2d91
    • A
      gfs2: Add rindex fields to rgrp headers · 166725d9
      Andrew Price 提交于
      Add rg_data0, rg_data and rg_bitbytes to struct gfs2_rgrp. The fields
      are identical to their counterparts in struct gfs2_rindex and are
      intended to reduce the use of the rindex. For now the fields are only
      written back as the in-memory equivalents in struct gfs2_rgrpd are set
      using values from the rindex. However, they are needed at this point so
      that userspace can make use of them, allowing a migration away from the
      rindex over time.
      
      The new fields take up previously reserved space which was explicitly
      zeroed on write so, in clusters with mixed kernels, these fields could
      get zeroed after being set and this should not be treated as an error.
      Signed-off-by: NAndrew Price <anprice@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      166725d9
    • A
      gfs2: Add a next-resource-group pointer to resource groups · 65adc273
      Andrew Price 提交于
      Add a new rg_skip field to struct gfs2_rgrp, replacing __pad. The
      rg_skip field has the following meaning:
      
      - If rg_skip is zero, it is considered unset and not useful.
      - If rg_skip is non-zero, its value will be the number of blocks between
        this rgrp's address and the next rgrp's address. This can be used as a
        hint by fsck.gfs2 when rebuilding a bad rindex, for example.
      
      This will provide less dependency on the rindex in future, and allow
      tools such as fsck.gfs2 to iterate the resource groups without keeping
      the rindex around.
      
      The field is updated in gfs2_rgrp_out() so that existing file systems
      will have it set. This means that any resource groups that aren't ever
      written will not be updated. The final rgrp is a special case as there
      is no next rgrp, so it will always have a rg_skip of 0 (unless the fs is
      extended).
      
      Before this patch, gfs2_rgrp_out() zeroes the __pad field explicitly, so
      the rg_skip field can get set back to 0 in cases where nodes with and
      without this patch are mixed in a cluster. In some cases, the field may
      bounce between being set by one node and then zeroed by another which
      may harm performance slightly, e.g. when two nodes create many small
      files. In testing this situation is rare but it becomes more likely as
      the filesystem fills up and there are fewer resource groups to choose
      from. The problem goes away when all nodes are running with this patch.
      Dipping into the space currently occupied by the rg_reserved field would
      have resulted in the same problem as it is also explicitly zeroed, so
      unfortunately there is no other way around it.
      Signed-off-by: NAndrew Price <anprice@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      65adc273
  5. 28 11月, 2017 4 次提交
    • L
      Rename superblock flags (MS_xyz -> SB_xyz) · 1751e8a6
      Linus Torvalds 提交于
      This is a pure automated search-and-replace of the internal kernel
      superblock flags.
      
      The s_flags are now called SB_*, with the names and the values for the
      moment mirroring the MS_* flags that they're equivalent to.
      
      Note how the MS_xyz flags are the ones passed to the mount system call,
      while the SB_xyz flags are what we then use in sb->s_flags.
      
      The script to do this was:
      
          # places to look in; re security/*: it generally should *not* be
          # touched (that stuff parses mount(2) arguments directly), but
          # there are two places where we really deal with superblock flags.
          FILES="drivers/mtd drivers/staging/lustre fs ipc mm \
                  include/linux/fs.h include/uapi/linux/bfs_fs.h \
                  security/apparmor/apparmorfs.c security/apparmor/include/lib.h"
          # the list of MS_... constants
          SYMS="RDONLY NOSUID NODEV NOEXEC SYNCHRONOUS REMOUNT MANDLOCK \
                DIRSYNC NOATIME NODIRATIME BIND MOVE REC VERBOSE SILENT \
                POSIXACL UNBINDABLE PRIVATE SLAVE SHARED RELATIME KERNMOUNT \
                I_VERSION STRICTATIME LAZYTIME SUBMOUNT NOREMOTELOCK NOSEC BORN \
                ACTIVE NOUSER"
      
          SED_PROG=
          for i in $SYMS; do SED_PROG="$SED_PROG -e s/MS_$i/SB_$i/g"; done
      
          # we want files that contain at least one of MS_...,
          # with fs/namespace.c and fs/pnode.c excluded.
          L=$(for i in $SYMS; do git grep -w -l MS_$i $FILES; done| sort|uniq|grep -v '^fs/namespace.c'|grep -v '^fs/pnode.c')
      
          for f in $L; do sed -i $f $SED_PROG; done
      Requested-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1751e8a6
    • A
      gfs2: Remove unused gfs2_write_jdata_pagevec parameter · 9aa01593
      Andreas Gruenbacher 提交于
      As a follow-up to commit d2bc5b3c, remove the end parameter which is
      now unused.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      9aa01593
    • T
      gfs2: Fix wrong error handling in init_gfs2_fs() · 8b0d7f56
      Tetsuo Handa 提交于
      init_gfs2_fs() is calling e.g. calling unregister_shrinker() without
      register_shrinker() when an error occurred during initialization.
      Rename goto labels and call appropriate undo function.
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      8b0d7f56
    • B
      GFS2: Combine gfs2_free_di with gfs2_free_uninit_di · a18c78c5
      Bob Peterson 提交于
      Before this patch, function gfs2_free_di was 4 lines of code, and
      one of those lines was to call gfs2_free_uninit_di. Although
      unlikely, if function gfs2_free_uninit_di encountered an error
      finding the block to be freed, the error was silently ignored by the
      caller, which went ahead and improperly did a quota-change operation
      and meta_wipe despite the error. This patch combines the two
      functions into one to make the code more readable and fixes the bug
      by returning from the combined function before it takes those next
      incorrect steps.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      a18c78c5
  6. 16 11月, 2017 3 次提交
  7. 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
  8. 31 10月, 2017 11 次提交
  9. 26 9月, 2017 2 次提交