Skip to content
Snippets Groups Projects
  1. Jul 29, 2019
  2. Jul 09, 2019
    • Darrick J. Wong's avatar
      xfs: bump INUMBERS cursor correctly in xfs_inumbers_walk · 0df5c39b
      Darrick J. Wong authored
      
      There's a subtle unit conversion error when we increment the INUMBERS
      cursor at the end of xfs_inumbers_walk.  If there's an inode chunk at
      the very end of the AG /and/ the AG size is a perfect power of two, the
      startino of that last chunk (which is in units of AG inodes) will be 63
      less than (1 << agino_log).  If we add XFS_INODES_PER_CHUNK to the
      startino, we end up with a startino that's larger than (1 << agino_log)
      and when we convert that back to fs inode units we'll rip off that upper
      bit and wind up back at the start of the AG.
      
      Fix this by converting to units of fs inodes before adding
      XFS_INODES_PER_CHUNK so that we'll harmlessly end up pointing to the
      next AG.
      
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      0df5c39b
  3. Jul 04, 2019
  4. Jul 02, 2019
  5. Jun 29, 2019
  6. Jun 12, 2019
  7. Apr 15, 2019
  8. Dec 12, 2018
  9. Jul 26, 2018
  10. Jul 23, 2018
  11. Jun 08, 2018
  12. Jun 06, 2018
    • Dave Chinner's avatar
      xfs: convert to SPDX license tags · 0b61f8a4
      Dave Chinner authored
      
      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: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      0b61f8a4
  13. Oct 26, 2017
  14. Jun 19, 2017
  15. Apr 03, 2017
  16. Mar 08, 2017
  17. Oct 05, 2016
    • Darrick J. Wong's avatar
      xfs: create a separate cow extent size hint for the allocator · f7ca3522
      Darrick J. Wong authored
      
      Create a per-inode extent size allocator hint for copy-on-write.  This
      hint is separate from the existing extent size hint so that CoW can
      take advantage of the fragmentation-reducing properties of extent size
      hints without disabling delalloc for regular writes.
      
      The extent size hint that's fed to the allocator during a copy on
      write operation is the greater of the cowextsize and regular extsize
      hint.
      
      During reflink, if we're sharing the entire source file to the entire
      destination file and the destination file doesn't already have a
      cowextsize hint, propagate the source file's cowextsize hint to the
      destination file.
      
      Furthermore, zero the bulkstat buffer prior to setting the fields
      so that we don't copy kernel memory contents into userspace.
      
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      f7ca3522
  18. Feb 09, 2016
  19. Aug 19, 2015
    • Brian Foster's avatar
      xfs: fix btree cursor error cleanups · f307080a
      Brian Foster authored
      
      The btree cursor cleanup function takes an error parameter that
      affects how buffers are released from the cursor. All buffers are
      released in the event of error. Several callers do not specify the
      XFS_BTREE_ERROR flag in the event of error, however. This can cause
      buffers to hang around locked or with an elevated hold count and
      thus lead to umount hangs in the event of errors.
      
      Fix up the xfs_btree_del_cursor() callers to pass XFS_BTREE_ERROR if
      the cursor is being torn down due to error.
      
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      f307080a
  20. May 28, 2015
    • Brian Foster's avatar
      xfs: use actual inode count for sparse records in bulkstat/inumbers · 12d0714d
      Brian Foster authored
      
      The bulkstat and inumbers mechanisms make the assumption that inode
      records consist of a full 64 inode chunk in several places. For example,
      this is used to track how many inodes have been processed overall as
      well as to determine whether a record has allocated inodes that must be
      handled.
      
      This assumption is invalid for sparse inode records. While sparse inodes
      will be marked as free in the ir_free mask, they are not accounted as
      free in ir_freecount because they cannot be allocated. Therefore,
      ir_freecount may be less than 64 inodes in an inode record for which all
      physically allocated inodes are free (and in turn ir_freecount < 64 does
      not signify that the record has allocated inodes).
      
      The new in-core inobt record format includes the ir_count field. This
      holds the number of true, physical inodes tracked by the record. The
      in-core ir_count field is always valid as it is hardcoded to
      XFS_INODES_PER_CHUNK when sparse inodes is not enabled. Use ir_count to
      handle inode records correctly in bulkstat in a generic manner.
      
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      12d0714d
  21. Feb 23, 2015
  22. Dec 03, 2014
  23. Nov 28, 2014
  24. Nov 06, 2014
    • Dave Chinner's avatar
      xfs: track bulkstat progress by agino · 00275899
      Dave Chinner authored
      
      The bulkstat main loop progress is tracked by the "lastino"
      variable, which is a full 64 bit inode. However, the loop actually
      works on agno/agino pairs, and so there's a significant disconnect
      between the rest of the loop and the main cursor. Convert this to
      use the agino, and pass the agino into the chunk formatting function
      and convert it too.
      
      This gets rid of the inconsistency in the loop processing, and
      finally makes it simple for us to skip inodes at any point in the
      loop simply by incrementing the agino cursor.
      
      cc: <stable@vger.kernel.org> # 3.17
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
      00275899
    • Dave Chinner's avatar
      xfs: bulkstat error handling is broken · febe3cbe
      Dave Chinner authored
      
      The error propagation is a horror - xfs_bulkstat() returns
      a rval variable which is only set if there are formatter errors. Any
      sort of btree walk error or corruption will cause the bulkstat walk
      to terminate but will not pass an error back to userspace. Worse
      is the fact that formatter errors will also be ignored if any inodes
      were correctly formatted into the user buffer.
      
      Hence bulkstat can fail badly yet still report success to userspace.
      This causes significant issues with xfsdump not dumping everything
      in the filesystem yet reporting success. It's not until a restore
      fails that there is any indication that the dump was bad and tha
      bulkstat failed. This patch now triggers xfsdump to fail with
      bulkstat errors rather than silently missing files in the dump.
      
      This now causes bulkstat to fail when the lastino cookie does not
      fall inside an existing inode chunk. The pre-3.17 code tolerated
      that error by allowing the code to move to the next inode chunk
      as the agino target is guaranteed to fall into the next btree
      record.
      
      With the fixes up to this point in the series, xfsdump now passes on
      the troublesome filesystem image that exposes all these bugs.
      
      cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      febe3cbe
Loading