public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
To: Mike Frysinger <vapier@gentoo.org>, ltp-list@lists.sourceforge.net
Cc: vasily.isaenko@oracle.com
Subject: Re: [LTP] [PATCH 2/3] isofs.sh: be more quiet
Date: Fri, 21 Mar 2014 14:44:35 +0400	[thread overview]
Message-ID: <532C1813.9060609@oracle.com> (raw)
In-Reply-To: <532706B4.4060500@oracle.com>



On 03/17/2014 06:29 PM, Stanislav Kholmanskikh wrote:
> Hi!
>
> On 14.03.2014 00:56, Mike Frysinger wrote:
>> On Thu 13 Mar 2014 16:38:25 Stanislav Kholmanskikh wrote:
>>>    		echo "Running ls -lR $MNT_POINT Command"
>>> -		ls -lR $MNT_POINT
>>> +		ls -lR $MNT_POINT > /dev/null
>>
>> the point of this command is to show the contents of the mount.  if you're not
>> doing that, then delete the call (and the echo above it).
>
> Ok. I'll delete this call.
>
>
>> -mike
>>

I think we were incorrect about it.

The implicit point of the above commands is to give the OS (kernel/udev) 
some time to complete all actions needed to handle a new loop device 
creation situation.

For example, consider this script:

#!/bin/sh

for mount_opt in \
         "loop" \
         "loop,norock" \
         "loop,nojoliet" \
         "loop,block=512,unhide" \
         "loop,block=2048,nocompress" \
         "loop,check=strict,map=off,gid=bin,uid=bin" \
         "loop,check=strict,map=acorn,gid=bin,uid=bin" \
         "loop,check=relaxed,map=normal" \
         "loop,block=512,unhide,session=2"
do
         echo "mount_opt = $mount_opt"
         losetup -a
         mount -t iso9660 -o $mount_opt /tmp/isofs.iso /tmp/mnt
#        ls -lR /tmp/mnt > /dev/null
         umount /tmp/mnt

done

sleep 2
echo "after sleep"
losetup -a

If we execute it, we may get:
mount_opt = loop
mount_opt = loop,norock
/dev/loop0: [fc00]:131091 (/tmp/isofs.iso)
mount_opt = loop,nojoliet
/dev/loop0: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop1: [fc00]:131091 (/tmp/isofs.iso)
mount_opt = loop,block=512,unhide
/dev/loop0: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop1: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop2: [fc00]:131091 (/tmp/isofs.iso)
mount_opt = loop,block=2048,nocompress
/dev/loop1: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop2: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop3: [fc00]:131091 (/tmp/isofs.iso)
mount_opt = loop,check=strict,map=off,gid=bin,uid=bin
/dev/loop0: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop2: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop3: [fc00]:131091 (/tmp/isofs.iso)
mount_opt = loop,check=strict,map=acorn,gid=bin,uid=bin
/dev/loop0: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop1: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop3: [fc00]:131091 (/tmp/isofs.iso)
mount_opt = loop,check=relaxed,map=normal
/dev/loop0: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop1: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop2: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop3: [fc00]:131091 (/tmp/isofs.iso)
mount_opt = loop,block=512,unhide,session=2
/dev/loop2: [fc00]:131091 (/tmp/isofs.iso)
/dev/loop4: [fc00]:131091 (/tmp/isofs.iso)
after sleep

And if we uncomment 'ls -lR > /dev/null', we will get a clean output:
mount_opt = loop
mount_opt = loop,norock
mount_opt = loop,nojoliet
mount_opt = loop,block=512,unhide
mount_opt = loop,block=2048,nocompress
mount_opt = loop,check=strict,map=off,gid=bin,uid=bin
mount_opt = loop,check=strict,map=acorn,gid=bin,uid=bin
mount_opt = loop,check=relaxed,map=normal
mount_opt = loop,block=512,unhide,session=2
after sleep

So the more test cases we have the higher the probability is that sooner 
or later the OS will have no available loop devices.

The above commands were executed on a kernel with 
a1ecac3b0656a68259927c234e505804d33a7b83 patch.

I think that according to the patch the described behaviour is 
absolutely expected. Therefore It would be better to leave "ls -lR" in 
the test or insert a 'sleep' instead. In this case we would use no more 
than 2 loop devices per iteration.

Guys, what do you think?

PS: On a kernel without this patch it's very likely that an umount 
operation will fail with:
loop: can't delete device /dev/loop0: Device or resource busy


>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
>

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2014-03-21 10:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-13 12:38 [LTP] Let's use isofs.sh as an ordinary test case Stanislav Kholmanskikh
2014-03-13 12:38 ` [LTP] [PATCH 1/3] isofs.sh: use $TMPDIR for temporary directory Stanislav Kholmanskikh
2014-03-13 20:55   ` Mike Frysinger
2014-03-17 14:39     ` Stanislav Kholmanskikh
2014-03-13 12:38 ` [LTP] [PATCH 2/3] isofs.sh: be more quiet Stanislav Kholmanskikh
2014-03-13 20:56   ` Mike Frysinger
2014-03-17 14:29     ` Stanislav Kholmanskikh
2014-03-21 10:44       ` Stanislav Kholmanskikh [this message]
2014-03-21 13:43         ` Stanislav Kholmanskikh
2014-03-24 10:04           ` [LTP] [PATCH V2 1/4] testscripts/isofs.sh: cleanup Stanislav Kholmanskikh
2014-03-24 10:04           ` [LTP] [PATCH V2 2/4] testscripts/isofs.sh: use the new shell interface Stanislav Kholmanskikh
2014-03-24 10:04           ` [LTP] [PATCH V2 3/4] testscripts/isofs.sh: removed some "unnecessary" steps Stanislav Kholmanskikh
2014-03-24 10:04           ` [LTP] [PATCH V2 4/4] Declare an iso9660 fs testcase based on isofs.sh Stanislav Kholmanskikh
2014-03-27  6:15           ` [LTP] [PATCH 2/3] isofs.sh: be more quiet Mike Frysinger
2014-03-27 14:25             ` chrubis
2014-03-13 12:38 ` [LTP] [RFC PATCH 3/3] Declare iso9660 fs testcase based on isofs.sh Stanislav Kholmanskikh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=532C1813.9060609@oracle.com \
    --to=stanislav.kholmanskikh@oracle.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=vapier@gentoo.org \
    --cc=vasily.isaenko@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox