1. 12 3月, 2020 2 次提交
    • D
      xfs: fix buffer corruption reporting when xfs_dir3_free_header_check fails · ce99494c
      Darrick J. Wong 提交于
      xfs_verifier_error is supposed to be called on a corrupt metadata buffer
      from within a buffer verifier function, whereas xfs_buf_mark_corrupt
      is the function to be called when a piece of code has read a buffer and
      catches something that a read verifier cannot.  The first function sets
      b_error anticipating that the low level buffer handling code will see
      the nonzero b_error and clear XBF_DONE on the buffer, whereas the second
      function does not.
      
      Since xfs_dir3_free_header_check examines fields in the dir free block
      header that require more context than can be provided to read verifiers,
      we must call xfs_buf_mark_corrupt when it finds a problem.
      
      Switching the calls has a secondary effect that we no longer corrupt the
      buffer state by setting b_error and leaving XBF_DONE set.  When /that/
      happens, we'll trip over various state assertions (most commonly the
      b_error check in xfs_buf_reverify) on a subsequent attempt to read the
      buffer.
      
      Fixes: bc1a09b8 ("xfs: refactor verifier callers to print address of failing check")
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      ce99494c
    • D
      xfs: add a function to deal with corrupt buffers post-verifiers · 8d57c216
      Darrick J. Wong 提交于
      Add a helper function to get rid of buffers that we have decided are
      corrupt after the verifiers have run.  This function is intended to
      handle metadata checks that can't happen in the verifiers, such as
      inter-block relationship checking.  Note that we now mark the buffer
      stale so that it will not end up on any LRU and will be purged on
      release.
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      8d57c216
  2. 23 11月, 2019 3 次提交
  3. 14 11月, 2019 2 次提交
  4. 11 11月, 2019 18 次提交
  5. 05 11月, 2019 1 次提交
  6. 31 8月, 2019 5 次提交
  7. 13 8月, 2019 1 次提交
  8. 29 6月, 2019 3 次提交
  9. 09 3月, 2019 2 次提交
  10. 12 2月, 2019 1 次提交
  11. 18 7月, 2018 1 次提交
  12. 07 6月, 2018 1 次提交
    • D
      xfs: convert to SPDX license tags · 0b61f8a4
      Dave Chinner 提交于
      Remove the verbose license text from XFS files and replace them
      with SPDX tags. This does not change the license of any of the code,
      merely refers to the common, up-to-date license files in LICENSES/
      
      This change was mostly scripted. fs/xfs/Makefile and
      fs/xfs/libxfs/xfs_fs.h were modified by hand, the rest were detected
      and modified by the following command:
      
      for f in `git grep -l "GNU General" fs/xfs/` ; do
      	echo $f
      	cat $f | awk -f hdr.awk > $f.new
      	mv -f $f.new $f
      done
      
      And the hdr.awk script that did the modification (including
      detecting the difference between GPL-2.0 and GPL-2.0+ licenses)
      is as follows:
      
      $ cat hdr.awk
      BEGIN {
      	hdr = 1.0
      	tag = "GPL-2.0"
      	str = ""
      }
      
      /^ \* This program is free software/ {
      	hdr = 2.0;
      	next
      }
      
      /any later version./ {
      	tag = "GPL-2.0+"
      	next
      }
      
      /^ \*\// {
      	if (hdr > 0.0) {
      		print "// SPDX-License-Identifier: " tag
      		print str
      		print $0
      		str=""
      		hdr = 0.0
      		next
      	}
      	print $0
      	next
      }
      
      /^ \* / {
      	if (hdr > 1.0)
      		next
      	if (hdr > 0.0) {
      		if (str != "")
      			str = str "\n"
      		str = str $0
      		next
      	}
      	print $0
      	next
      }
      
      /^ \*/ {
      	if (hdr > 0.0)
      		next
      	print $0
      	next
      }
      
      // {
      	if (hdr > 0.0) {
      		if (str != "")
      			str = str "\n"
      		str = str $0
      		next
      	}
      	print $0
      }
      
      END { }
      $
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
      0b61f8a4