public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/25, V3] xfs: metadata buffer verifiers
@ 2012-10-25  6:33 Dave Chinner
  2012-10-25  6:33 ` [PATCH 01/25] xfs: growfs: don't read garbage for new secondary superblocks Dave Chinner
                   ` (24 more replies)
  0 siblings, 25 replies; 69+ messages in thread
From: Dave Chinner @ 2012-10-25  6:33 UTC (permalink / raw)
  To: xfs

Hi folks,

Third version of the buffer verifier series. The read verifier
infrastructure is described here:

http://oss.sgi.com/archives/xfs/2012-10/msg00146.html

This version converts to a buffer operations structure rather than
specific write/iodone callback installations and adds log recovery
write verifiers. There are also several bugs fixed and review
comments address.

This series is essentially now functionally complete, so there is
nothing really left to add to this except for addressing review
comments and bug fixing. Comments welcome. ;)

FYI, I do have more changes lined up for the 3.8 window, but I will
be posting them as separate patches on top of this series and not as
part of it.

Cheers,

Dave.

--

Changes in version 3:
- update agfl verfier commit to mention debug checks are being done
  unconditionally now.
- fixed agfl verifier null point crash when invalid block numbers
  are found
- ifdef'd out agfl verifier checks as they are not reliable because
  mkfs does not initialise the full AGFL to known values.
- fixed quiet mount flag handling for superblock verification.
- directorry -> directory
- convert to struct buf_ops method of attaching verifiers to the
  buffer. This provides a much cleaner abstraction and simpler
  future expansion of operations on the buffer. It removes a great
  deal of code that is repeated through all the verifiers, too, by
  separating them from buffer IO completion processing.
- add initial support for log write verifiers

  Log write verifiers are, in general, identical to the existing
  verifiers. There are only a small number of modifications
  necessary, mainly due to log recovery occurring before certain
  in-memory structures are initialised (e.g. the struct xfs_perag).
  Write verifiers that need different checks during recovery do so
  via detection of the XLOG_ACTIVE_RECOVERY flag on the log.

  Log recovery does not do read verification of the buffers at this
  point in time, mainly due to the fact we don't know what the
  contents of the buffer is before we read it - the buffer logging
  is generic and content unaware. However, almost all metadata has
  magic numbers in it, so after the changes have been replayed into
  the buffer we can snoop the magic number out of the buffer and
  attach the appropriate verifier before it is written back. Hence
  we should catch gross corruptions introduced by recovery errors.

Changes in Version 2:

- fixed use of xfs_dir2_db_t instead of xfs_dablk_t in directory and
  attr read functions (found when testing xfstests --large-fs on a
  500TB fs and attribute block numbers went beyond 32 bits). This
  mistake was copy-n-pasted several times.
- fixed use of "int map_type" instead of "xfs_daddr_t mappedbno" in
  directory and attr read functions.
- fixed incorrect logic in xfs_dir2_block_verify where a failed
  block check would not clear the block_ok flag correctly
- invalidate allocbt->freelist buffers so they don't get written
  after being freed and while still on the freelist
- added initial suppor for write verifiers.

  Write verifiers are similar to read verifiers, the are simply
  called just prior to issuing the IO on the buffer. The buffer is
  locked at this point, so we are guaranteed an unchanging buffer
  to work from.

  The initial write verifiers are simply the same as the read
  verifiers, except they don't have the ioend processing in them. A
  failure of the write verifier will cause the filesystem to shut
  down as writing invalid metadata to disk is a bad thing. The write
  verifier for the alloc btree blocks was what discovered the
  writing of freed allocbt blocks to disk from the free list.

  Eventually, the metadata CRC will be calculated in the write
  verifier after validating that the buffer contents are valid.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 69+ messages in thread

end of thread, other threads:[~2012-10-31 10:18 UTC | newest]

Thread overview: 69+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-25  6:33 [PATCH 00/25, V3] xfs: metadata buffer verifiers Dave Chinner
2012-10-25  6:33 ` [PATCH 01/25] xfs: growfs: don't read garbage for new secondary superblocks Dave Chinner
2012-10-30  0:17   ` Phil White
2012-10-25  6:33 ` [PATCH 02/25] xfs: invalidate allocbt blocks moved to the free list Dave Chinner
2012-10-26  8:47   ` Christoph Hellwig
2012-10-30  0:22   ` Phil White
2012-10-25  6:33 ` [PATCH 03/25] xfs: make buffer read verication an IO completion function Dave Chinner
2012-10-30  0:29   ` Phil White
2012-10-30  0:45     ` Dave Chinner
2012-10-30  0:55       ` Phil White
2012-10-25  6:33 ` [PATCH 04/25] xfs: uncached buffer reads need to return an error Dave Chinner
2012-10-26  8:48   ` Christoph Hellwig
2012-10-30  0:36   ` Phil White
2012-10-25  6:33 ` [PATCH 05/25] xfs: verify superblocks as they are read from disk Dave Chinner
2012-10-30  0:48   ` Phil White
2012-10-25  6:33 ` [PATCH 06/25] xfs: verify AGF blocks " Dave Chinner
2012-10-30  0:51   ` Phil White
2012-10-25  6:33 ` [PATCH 07/25] xfs: verify AGI " Dave Chinner
2012-10-30  0:53   ` Phil White
2012-10-30 22:13     ` Dave Chinner
2012-10-25  6:33 ` [PATCH 08/25] xfs: verify AGFL " Dave Chinner
2012-10-30  1:00   ` Phil White
2012-10-25  6:33 ` [PATCH 09/25] xfs: verify inode buffers " Dave Chinner
2012-10-30  1:06   ` Phil White
2012-10-25  6:33 ` [PATCH 10/25] xfs: verify btree blocks " Dave Chinner
2012-10-30  1:14   ` Phil White
2012-10-25  6:34 ` [PATCH 11/25] xfs: verify dquot " Dave Chinner
2012-10-30  1:36   ` Phil White
2012-10-25  6:34 ` [PATCH 12/25] xfs: add verifier callback to directory read code Dave Chinner
2012-10-30  3:15   ` Phil White
2012-10-25  6:34 ` [PATCH 13/25] xfs: factor dir2 block read operations Dave Chinner
2012-10-30  3:23   ` Phil White
2012-10-30 22:16     ` Dave Chinner
2012-10-25  6:34 ` [PATCH 14/25] xfs: verify dir2 block format buffers Dave Chinner
2012-10-30  3:26   ` Phil White
2012-10-25  6:34 ` [PATCH 15/25] xfs: factor dir2 free block reading Dave Chinner
2012-10-30 13:14   ` Phil White
2012-10-25  6:34 ` [PATCH 16/25] xfs: factor out dir2 data " Dave Chinner
2012-10-30 13:21   ` Phil White
2012-10-25  6:34 ` [PATCH 17/25] xfs: factor dir2 leaf read Dave Chinner
2012-10-30 13:22   ` Phil White
2012-10-25  6:34 ` [PATCH 18/25] xfs: factor and verify attr leaf reads Dave Chinner
2012-10-30 13:26   ` Phil White
2012-10-25  6:34 ` [PATCH 19/25] xfs: add xfs_da_node verification Dave Chinner
2012-10-30 13:30   ` Phil White
2012-10-30 22:23     ` Dave Chinner
2012-10-31  0:23       ` Phil White
2012-10-31  0:50         ` Dave Chinner
2012-10-25  6:34 ` [PATCH 20/25] xfs: Add verifiers to dir2 data readahead Dave Chinner
2012-10-30 13:31   ` Phil White
2012-10-25  6:34 ` [PATCH 21/25] xfs: add buffer pre-write callback Dave Chinner
2012-10-26  8:50   ` Christoph Hellwig
2012-10-30 22:30     ` Dave Chinner
2012-10-31 10:20       ` Christoph Hellwig
2012-10-30 13:32   ` Phil White
2012-10-25  6:34 ` [PATCH 22/25] xfs: add pre-write metadata buffer verifier callbacks Dave Chinner
2012-10-30 13:34   ` Phil White
2012-10-25  6:34 ` [PATCH 23/25] xfs: connect up write verifiers to new buffers Dave Chinner
2012-10-30 13:39   ` Phil White
2012-10-30 22:34     ` Dave Chinner
2012-10-25  6:34 ` [PATCH 24/25] xfs: convert buffer verifiers to an ops structure Dave Chinner
2012-10-30 13:41   ` Phil White
2012-10-25  6:34 ` [PATCH 25/25] xfs: add write verifiers to log recovery Dave Chinner
2012-10-26  8:54   ` Christoph Hellwig
2012-10-26 20:31     ` Dave Chinner
2012-10-30 12:23       ` Christoph Hellwig
2012-10-30 22:08         ` Dave Chinner
2012-10-31 10:19           ` Christoph Hellwig
2012-10-30 13:44   ` Phil White

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox