* [PATCH] xfstests: check for valid input to _scratch_mkfs_sized
@ 2013-09-17 19:30 Eric Sandeen
2013-09-17 20:41 ` Mark Tinguely
2013-10-16 20:57 ` Rich Johnston
0 siblings, 2 replies; 4+ messages in thread
From: Eric Sandeen @ 2013-09-17 19:30 UTC (permalink / raw)
To: xfs-oss
_scratch_mkfs_sized requires an integer number of bytes
as input; if it's given something else, catch it and _notrun.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/common/rc b/common/rc
index 77e96c4..6afc164 100644
--- a/common/rc
+++ b/common/rc
@@ -569,6 +569,15 @@ _scratch_mkfs_sized()
fssize=$1
blocksize=$2
[ -z "$blocksize" ] && blocksize=4096
+
+ re='^[0-9]+$'
+ if ! [[ $fssize =~ $re ]] ; then
+ _notrun "error: _scratch_mkfs_sized: fs size \"$fssize\" not an integer."
+ fi
+ if ! [[ $blocksize =~ $re ]] ; then
+ _notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer."
+ fi
+
blocks=`expr $fssize / $blocksize`
if [ "$HOSTOS" == "Linux" ]; then
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] xfstests: check for valid input to _scratch_mkfs_sized
2013-09-17 19:30 [PATCH] xfstests: check for valid input to _scratch_mkfs_sized Eric Sandeen
@ 2013-09-17 20:41 ` Mark Tinguely
2013-09-17 21:11 ` Eric Sandeen
2013-10-16 20:57 ` Rich Johnston
1 sibling, 1 reply; 4+ messages in thread
From: Mark Tinguely @ 2013-09-17 20:41 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
On 09/17/13 14:30, Eric Sandeen wrote:
> _scratch_mkfs_sized requires an integer number of bytes
> as input; if it's given something else, catch it and _notrun.
>
> Signed-off-by: Eric Sandeen<sandeen@redhat.com>
> ---
Ah, the "don't do what Mark did" patch.
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xfstests: check for valid input to _scratch_mkfs_sized
2013-09-17 20:41 ` Mark Tinguely
@ 2013-09-17 21:11 ` Eric Sandeen
0 siblings, 0 replies; 4+ messages in thread
From: Eric Sandeen @ 2013-09-17 21:11 UTC (permalink / raw)
To: Mark Tinguely; +Cc: xfs-oss
On 9/17/13 3:41 PM, Mark Tinguely wrote:
> On 09/17/13 14:30, Eric Sandeen wrote:
>> _scratch_mkfs_sized requires an integer number of bytes
>> as input; if it's given something else, catch it and _notrun.
>>
>> Signed-off-by: Eric Sandeen<sandeen@redhat.com>
>> ---
>
> Ah, the "don't do what Mark did" patch.
the "make life easier for future Marks" patch. ;)
> Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Thanks!
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xfstests: check for valid input to _scratch_mkfs_sized
2013-09-17 19:30 [PATCH] xfstests: check for valid input to _scratch_mkfs_sized Eric Sandeen
2013-09-17 20:41 ` Mark Tinguely
@ 2013-10-16 20:57 ` Rich Johnston
1 sibling, 0 replies; 4+ messages in thread
From: Rich Johnston @ 2013-10-16 20:57 UTC (permalink / raw)
To: Eric Sandeen, xfs-oss
This has been committed.
Thanks
--Rich
commit 969ed71b7073975ce4113e0f75d42e67c88cfcf9
Author: Eric Sandeen <sandeen@redhat.com>
Date: Tue Sep 17 19:30:41 2013 +0000
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-16 20:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-17 19:30 [PATCH] xfstests: check for valid input to _scratch_mkfs_sized Eric Sandeen
2013-09-17 20:41 ` Mark Tinguely
2013-09-17 21:11 ` Eric Sandeen
2013-10-16 20:57 ` Rich Johnston
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox