test out a remount bug where ro->rw doesn't update xfs flag and thinks it is
authorTim Shimmin <tes@sgi.com>
Tue, 14 Oct 2008 14:58:57 +0000 (14:58 +0000)
committerTim Shimmin <tes@sgi.com>
Tue, 14 Oct 2008 14:58:57 +0000 (14:58 +0000)
still readonly. Test using touch.
Code provided by Christoph Hellwig.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Merge of master-melb:xfs-cmds:32320a by kenmcd.

  test out a remount bug where ro->rw doesn't update xfs flag and thinks it is
  still readonly. Test using touch.
  Code provided by Christoph Hellwig.

189

diff --git a/189 b/189
index 764664a5265829175ef4081ee8add88a9eed414c..02b274ab7a3a4f92bf7fbb0fdce6174ec9679dbf 100644 (file)
--- a/189
+++ b/189
@@ -90,6 +90,34 @@ _test_remount_rw()
        umount $SCRATCH_MNT
 }
 
+#
+# make sure we really can write to a filesystem after remount,rw
+#
+_test_remount_write()
+{
+       echo
+       echo "try touching file after remount ro -> rw with options"
+       echo
+       _scratch_mount
+       [ $? -eq 0 ] || echo "mount (1) failed unexpectedly"
+
+       touch $SCRATCH_MNT/foobar
+       [ $? -eq 0 ] || echo "touch (1) failed unexpectedly"
+
+       umount $SCRATCH_MNT
+
+       _scratch_mount -o ro
+       [ $? -eq 0 ] || echo "mount (2) failed unexpectedly"
+
+       _mount -o remount,rw,filestreams $SCRATCH_MNT
+       [ $? -eq 0 ] || echo "remount failed unexpectedly"
+
+       touch $SCRATCH_MNT/foobar
+       [ $? -eq 0 ] || echo "touch (2) failed unexpectedly"
+
+       umount $SCRATCH_MNT
+}
+
 #
 # barrier is the only option we can change besides ro<->rw which is partially
 # handled by the VFS and tested elsewhere.  Make sure mount accepts going
@@ -167,6 +195,7 @@ _scratch_mkfs_xfs | _filter_mkfs 2>/dev/null
 
 _add_scratch_fstab
 _test_remount_rw
+_test_remount_write
 
 echo
 echo "add noikeep to fstab for scratch"