public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [patch][xfstests-dev] 078: xfs_repair should be run against the losetup'd device, not the image file
@ 2011-02-11 22:04 Jeff Moyer
  2011-02-11 20:20 ` [patch][xfstests] 240: only run when the file system block size is larger than the disk sector size Jeff Moyer
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Moyer @ 2011-02-11 22:04 UTC (permalink / raw)
  To: xfs

Hi,

When running test 078 against a 4k logical block sized disk, it fails in
xfs_repair.  The problem is that xfs_repair is passed the loopback
filename instead of the actual loop device.  This means that it opens
the file O_DIRECT, and tries to do 512 byte aligned I/O to a 4k sector
device.  The loop device, for better or for worse, will do buffered I/O,
and thus does not suffer from the same problem.  So, the attached patch
sets up the loop device and passes that to xfs_repair.  This resolves
the issue on my test system.

Comments are more than welcome.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>

diff --git a/078 b/078
index b8d9132..5cb66df 100755
--- a/078
+++ b/078
@@ -53,7 +53,7 @@ _supported_os Linux
 # Must have loop device
 _require_loop
 
-LOOP_DEV=$TEST_DIR/$seq.fs
+LOOP_IMG=$TEST_DIR/$seq.fs
 LOOP_MNT=$TEST_DIR/$seq.mnt
 
 _filter_io()
@@ -75,7 +75,7 @@ _grow_loop()
 	check=$4
 	agsize=$5
 
-	dparam="file,name=$LOOP_DEV,size=$original"
+	dparam="file,name=$LOOP_IMG,size=$original"
 	if [ -n "$agsize" ]; then
 		dparam="$dparam,agsize=$agsize"
 	fi
@@ -89,9 +89,9 @@ _grow_loop()
 		| _filter_mkfs 2>/dev/null
 
 	echo "*** extend loop file"
-	$XFS_IO_PROG -c "pwrite $new_size $bsize" $LOOP_DEV | _filter_io
+	$XFS_IO_PROG -c "pwrite $new_size $bsize" $LOOP_IMG | _filter_io
 	echo "*** mount loop filesystem"
-	mount -t xfs -o loop $LOOP_DEV $LOOP_MNT
+	mount -t xfs -o loop $LOOP_IMG $LOOP_MNT
 
 	echo "*** grow loop filesystem"
 	#xfs_growfs $LOOP_MNT 2>&1 | grep -e "^data" #| _filter_growfs 2>/dev/null
@@ -104,10 +104,13 @@ _grow_loop()
 	if [ "$check" -gt "0" ]
 	then
 		echo "*** check"
+		LOOP_DEV=`losetup -f`
+		losetup $LOOP_DEV $LOOP_IMG
 		 _check_xfs_filesystem $LOOP_DEV none none
+		losetup -d $LOOP_DEV
 	fi
 
-	rm -f $LOOP_DEV
+	rm -f $LOOP_IMG
 }
 
 # Wes' problem sizes...

_______________________________________________
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:[~2011-02-13 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-11 22:04 [patch][xfstests-dev] 078: xfs_repair should be run against the losetup'd device, not the image file Jeff Moyer
2011-02-11 20:20 ` [patch][xfstests] 240: only run when the file system block size is larger than the disk sector size Jeff Moyer
2011-02-11 19:08   ` [patch][xfstests-dev] aiodio_sparse2: fix up alignment for 4k logical block sized devices Jeff Moyer
2011-02-13 12:05     ` Christoph Hellwig

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