public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfsdump: add locks around the inventory put
@ 2013-10-01 16:30 Rich Johnston
  2013-10-01 21:06 ` Eric Sandeen
  0 siblings, 1 reply; 4+ messages in thread
From: Rich Johnston @ 2013-10-01 16:30 UTC (permalink / raw)
  To: xfs-oss

From: Phil White <cerise-xfs@l.armory.com>

Add locks around the inventory put to prevent inventory
corruption.

Signed-off-by: Phil White <cerise-xfs@l.armory.com>

diff --git a/dump/content.c b/dump/content.c
index ac19021..b8977bb 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -2550,8 +2550,11 @@ decision_more:
  				       scwhdrp->cih_startpt.sp_offset );
  			}

-			/* already thread-safe, don't need to lock
+			/* Supposedly already thread-safe, according to the
+			 * previous revisions, but corruption of inventory
+			 * objects can occur.
  			 */
  			 */
+			lock();
  			ok = inv_put_mediafile( inv_stmt,
  						&mwhdrp->mh_mediaid,
  						mwhdrp->mh_medialabel,
@@ -2565,6 +2568,7 @@ decision_more:
  						&&
  						! empty_mediafile,
  						BOOL_FALSE );
+			unlock();
  			if ( ! ok ) {
  				mlog( MLOG_NORMAL, _(
  				      "inventory media file put failed\n") );

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

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

end of thread, other threads:[~2013-10-03 14:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-01 16:30 [PATCH] xfsdump: add locks around the inventory put Rich Johnston
2013-10-01 21:06 ` Eric Sandeen
2013-10-01 22:19   ` Rich Johnston
2013-10-03 14:17   ` Rich Johnston

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