Re: [PATCH v2 4/6] overlay/017: create helpers to record and check inode numbers

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Fri, Apr 28, 2017 at 1:04 PM, Amir Goldstein <amir73il@xxxxxxxxx> wrote:
> On Fri, Apr 28, 2017 at 12:24 PM, Eryu Guan <eguan@xxxxxxxxxx> wrote:
>> On Fri, Apr 28, 2017 at 11:24:46AM +0300, Amir Goldstein wrote:
>>> Use helpers to records and check inode numbers so we can repeat
>>> the same test after rename and mount cycle.
>>>
>>> Suggested-by: Eryu Guan <eguan@xxxxxxxxxx>
>>> Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
>>> ---
>>>  tests/overlay/017 | 57 ++++++++++++++++++++++++++++++++++++++++---------------
>>>  1 file changed, 42 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/tests/overlay/017 b/tests/overlay/017
>>> index 779907d..3ff429f 100755
>>> --- a/tests/overlay/017
>>> +++ b/tests/overlay/017
>>> @@ -72,32 +72,59 @@ mknod $lowerdir/blkdev b 1 1
>>>  mknod $lowerdir/fifo p
>>>  $here/src/af_unix $lowerdir/socket
>>>
>>> +FILES="dir file symlink chrdev blkdev fifo socket"
>>> +
>>> +# Record inode numbers in format <ino> <basename>
>>> +function record_inode_numbers()
>>> +{
>>> +     dir=$1
>>> +     outfile=$2
>>> +
>>> +     for f in $FILES; do
>>> +             ls -id $dir/$f
>>> +     done | \
>>> +     while read ino file; do
>>> +             echo $ino `basename $file` >> $outfile
>>> +     done
>>> +}
>>> +
>>> +# Check inode numbers match recorder inode numbers
>>> +function check_inode_numbers()
>>> +{
>>> +     dir=$1
>>> +     before=$2
>>> +     after=$2
>>              ^^^ $3
>> Otherwise looks good to me. I can fix this typo at commit time.
>
> Oh boy! That's a lousy test :-)
> Now I wonder why the test failed when I ran it on kernel v4.10
> (when feeding after to find -inum)... something for me to check.
>

Ah. got it. 'after' inode number where appended to $tmp.before,
so find was also looking by the before inodes.
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux