diff mbox

[v2,1/3] generic/013: encapsulate remount during cleanup

Message ID 1409084918-17764-2-git-send-email-pshilovsky@samba.org (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Shilovsky Aug. 26, 2014, 8:28 p.m. UTC
The existing code calls remount for $TEST_DEV with constantly defined
mount options. This can fail if a user specifies different mount options.
Fix this by using new _test_remount() call that remounts $TEST_DEV.

Reviewed-by: Steve French <smfrench@gmail.com>
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
---
 common/rc         | 6 ++++++
 tests/generic/013 | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Christoph Hellwig Aug. 28, 2014, 5:08 p.m. UTC | #1
On Wed, Aug 27, 2014 at 12:28:36AM +0400, Pavel Shilovsky wrote:
> The existing code calls remount for $TEST_DEV with constantly defined
> mount options. This can fail if a user specifies different mount options.
> Fix this by using new _test_remount() call that remounts $TEST_DEV.

Looks technically correct, but I still wonder why it's needed at all,
I can't see anything in the test that would remount the filesystem
read-only.  git history isn't a help here as the remount goes back to
the first public revision.

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pavel Shilovsky Aug. 28, 2014, 6:50 p.m. UTC | #2
>> 28 ???. 2014 ?., ? 21:08, Christoph Hellwig <hch@infradead.org> ???????(?):
>> 
>> On Wed, Aug 27, 2014 at 12:28:36AM +0400, Pavel Shilovsky wrote:
>> The existing code calls remount for $TEST_DEV with constantly defined
>> mount options. This can fail if a user specifies different mount options.
>> Fix this by using new _test_remount() call that remounts $TEST_DEV.
> 
> Looks technically correct, but I still wonder why it's needed at all,
> I can't see anything in the test that would remount the filesystem
> read-only.  git history isn't a help here as the remount goes back to
> the first public revision.

Anyway I think it won't hurt to apply this patch at first and then probably remove this part at all.

--
Best regards,
Pavel Shilovsky.--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/common/rc b/common/rc
index 16da898..d9c9995 100644
--- a/common/rc
+++ b/common/rc
@@ -218,6 +218,12 @@  _test_mount()
     _mount -t $FSTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR
 }
 
+_test_remount()
+{
+    $UMOUNT_PROG $TEST_DEV
+    _test_mount
+}
+
 _scratch_mkfs_options()
 {
     _scratch_options mkfs
diff --git a/tests/generic/013 b/tests/generic/013
index 93d9904..534c9f0 100755
--- a/tests/generic/013
+++ b/tests/generic/013
@@ -35,7 +35,7 @@  _cleanup()
 {
     cd /
     # we might get here with a RO FS
-    mount -o remount,rw $TEST_DEV >/dev/null 2>&1
+    _test_remount
     # now remove fsstress directory.
     # N.B. rm(1) on IRIX can find problems when building up a long pathname
     # such that what it has is greater the 1024 chars and will