All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] repair: more fixes for 3.2.1
@ 2014-07-08 23:41 Dave Chinner
  2014-07-08 23:41 ` [PATCH 1/2] libxfs: clear the buffer error while the buffer is locked Dave Chinner
  2014-07-08 23:41 ` [PATCH 2/2] repair: handle uncorrected corruptions in phase 2 Dave Chinner
  0 siblings, 2 replies; 5+ messages in thread
From: Dave Chinner @ 2014-07-08 23:41 UTC (permalink / raw)
  To: xfs

Hi folks,

A couple more fixes for repair - the first being a change I missed
during review of the last patch series, and a new one that removes a
set of incorrect asserts when checking AG headers.

If nothing else pops up in the next couple of days, this is where I
want to draw the line for a 3.2.1 release, so having people run some
testing over the next couple of days woul dbe great....

-Dave.

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

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

* [PATCH 1/2] libxfs: clear the buffer error while the buffer is locked
  2014-07-08 23:41 [PATCH 0/2] repair: more fixes for 3.2.1 Dave Chinner
@ 2014-07-08 23:41 ` Dave Chinner
  2014-07-09  8:59   ` Christoph Hellwig
  2014-07-08 23:41 ` [PATCH 2/2] repair: handle uncorrected corruptions in phase 2 Dave Chinner
  1 sibling, 1 reply; 5+ messages in thread
From: Dave Chinner @ 2014-07-08 23:41 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

When releasing a buffer, the error shoul dbe cleared while the lock
is still held on the buffer to avoid racing with a new user of the
buffer.

This was pointed out in review of commit 6af7c1e ("libxfs: reused
invalidated buffers leak state and data") but the version committed
didn't have the fix. Thanks to Christoph Hellwig for checking and
pointing out the oversight.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 libxfs/rdwr.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 0294c98..9ee89d3 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -648,6 +648,12 @@ libxfs_getbuf_map(struct xfs_buftarg *btp, struct xfs_buf_map *map,
 void
 libxfs_putbuf(xfs_buf_t *bp)
 {
+	/*
+	 * ensure that any errors on this use of the buffer don't carry
+	 * over to the next user.
+	 */
+	bp->b_error = 0;
+
 #ifdef XFS_BUF_TRACING
 	pthread_mutex_lock(&libxfs_bcache->c_mutex);
 	lock_buf_count--;
@@ -663,11 +669,6 @@ libxfs_putbuf(xfs_buf_t *bp)
 			pthread_mutex_unlock(&bp->b_lock);
 		}
 	}
-	/*
-	 * ensure that any errors on this use of the buffer don't carry
-	 * over to the next user.
-	 */
-	bp->b_error = 0;
 
 	cache_node_put(libxfs_bcache, (struct cache_node *)bp);
 }
-- 
2.0.0

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

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

* [PATCH 2/2] repair: handle uncorrected corruptions in phase 2
  2014-07-08 23:41 [PATCH 0/2] repair: more fixes for 3.2.1 Dave Chinner
  2014-07-08 23:41 ` [PATCH 1/2] libxfs: clear the buffer error while the buffer is locked Dave Chinner
@ 2014-07-08 23:41 ` Dave Chinner
  2014-07-09  9:00   ` Christoph Hellwig
  1 sibling, 1 reply; 5+ messages in thread
From: Dave Chinner @ 2014-07-08 23:41 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

Some of the AG header corruptions detected by the IO verifiers
cannot be corrected in phase 2 when we do the initial scan of the
AGs. Correcting some errors cannot be done until a full rebuild of
the trees is done in phase 5.

Hence we can end up with a "clean" AGF/AGI buffer but have a
EFSCORRUPTED error on the buffer. This results in an assert failing:

	ASSERT(agf_dirty || agfbuf->b_error != EFSCORRUPTED);

and repair not beign able to fix the problems it has tripped over.
Hence the assert that we corrected all corruptions in the buffers
is not valid and should be removed.

Reported-by: Hans Kraus <hans.w.kraus@gmx.at>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 repair/scan.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/repair/scan.c b/repair/scan.c
index f29ff8d..142d8d7 100644
--- a/repair/scan.c
+++ b/repair/scan.c
@@ -1572,14 +1572,13 @@ scan_ag(
 
 	/*
 	 * Only pay attention to CRC/verifier errors if we can correct them.
-	 * While there, ensure that we corrected a corruption error if the
-	 * verifier detected one.
+	 * Note that we can get uncorrected EFSCORRUPTED errors here because
+	 * the verifier will flag on out of range values that we can't correct
+	 * until phase 5 when we have all the information necessary to rebuild
+	 * the freespace/inode btrees. We can correct bad CRC errors
+	 * immediately, though.
 	 */
 	if (!no_modify) {
-		ASSERT(agi_dirty || agibuf->b_error != EFSCORRUPTED);
-		ASSERT(agf_dirty || agfbuf->b_error != EFSCORRUPTED);
-		ASSERT(sb_dirty || sbbuf->b_error != EFSCORRUPTED);
-
 		agi_dirty += (agibuf->b_error == EFSBADCRC);
 		agf_dirty += (agfbuf->b_error == EFSBADCRC);
 		sb_dirty += (sbbuf->b_error == EFSBADCRC);
-- 
2.0.0

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

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

* Re: [PATCH 1/2] libxfs: clear the buffer error while the buffer is locked
  2014-07-08 23:41 ` [PATCH 1/2] libxfs: clear the buffer error while the buffer is locked Dave Chinner
@ 2014-07-09  8:59   ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2014-07-09  8:59 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Wed, Jul 09, 2014 at 09:41:39AM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> When releasing a buffer, the error shoul dbe cleared while the lock
> is still held on the buffer to avoid racing with a new user of the
> buffer.
> 
> This was pointed out in review of commit 6af7c1e ("libxfs: reused
> invalidated buffers leak state and data") but the version committed
> didn't have the fix. Thanks to Christoph Hellwig for checking and
> pointing out the oversight.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

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

* Re: [PATCH 2/2] repair: handle uncorrected corruptions in phase 2
  2014-07-08 23:41 ` [PATCH 2/2] repair: handle uncorrected corruptions in phase 2 Dave Chinner
@ 2014-07-09  9:00   ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2014-07-09  9:00 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

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

end of thread, other threads:[~2014-07-09  9:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-08 23:41 [PATCH 0/2] repair: more fixes for 3.2.1 Dave Chinner
2014-07-08 23:41 ` [PATCH 1/2] libxfs: clear the buffer error while the buffer is locked Dave Chinner
2014-07-09  8:59   ` Christoph Hellwig
2014-07-08 23:41 ` [PATCH 2/2] repair: handle uncorrected corruptions in phase 2 Dave Chinner
2014-07-09  9:00   ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.