Re: [PATCH 2/2] overlay/072: test for sharing inode with whiteout files

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

 



>  > > +
>  > > +# Case1:
>  > > +# Setting whiteout_link_max=0 will not share inode
>  > > +# with whiteout files, it means each whiteout file
>  > > +# will has it's own inode.
>  > > +
>  > > +file_count=10
>  > > +link_max=0
>  > > +link_count=1
>  >
>  > Would be nicer to put all the below in a run_test_case() function
>  > with above as arguments.
>  >
>
> Something like below?
> ---------
> # Arguments:
> # $1: Maximum link count
> # $2: Testing file number
> # $3: Expected link count
> run_test_case()
> {
>         _scratch_mkfs
>         _set_fs_module_param $param_name ${1}
>         make_lower_files ${2}
>         _scratch_mount
>         make_whiteout_files
>         check_whiteout_files ${2} ${3}
>         $UMOUNT_PROG $SCRATCH_MNT
> }
>
> link_max=1
> file_count=10
> link_count=1
> run_test_case $link_max $file_count $link_count
> ---------
>

Yes. That's better.

>  > > +_scratch_mkfs
>  > > +_set_fs_module_param $param_name $link_max
>  > > +make_lower_files
>  > > +_scratch_mount
>  > > +make_whiteout_files
>  > > +check_whiteout_files
>  > > +$UMOUNT_PROG $OVL_BASE_SCRATCH_MNT/$OVL_MNT
>  >
>  > Better:
>  > $UMOUNT_PROG $SCRATCH_MNT
>  >
>  > Even better:
>  > _scratch_umount
>
> I haven't found the definition of _scratch_umount,
> have we implemented it?

typo. I meant _scratch_unmount

On top of $UMOUNT_PROG $SCRATCH_MNT
_scratch_unmount also unmount the base fs.

...

>  > First, that is  strange outcome of whiteout_link_max=2
>  > I would not expect it.
>  > Second, how can every whiteout be shared with tmpfile?
>  > There should be at most one tmpfile at all times, so the
>  > whiteouts that already reached whiteout_link_max should
>  > not be linked to any tmpfile.
>
> I think I misunderstood your comment in my kernel patch, so I changed
> the logic to keep all tmpfiles in workdir and cleanup them during next mount.
> I'll fix it in V3 kernel patch.
>

Ah, so its good you posted the test ;-)

>  >
>  > Please add to test_case() verification that work dir contains
>  > at most one tmpfile.
>  > But please make sure that the test is clever enough to check
>  > both work and index dirs for tmpfiles (names beginning with #).
>  >
>
> So should I check module params of index and nfs_export for checking
> tmpfile in index dir?
>

No need for that.

Verifying that both index and work dir contain no more than a single tmpfile
together is good enough and should be pretty simple too:

ls $workdir/work/#* $workdir/index/#*|wc -l

Thanks,
Amir.



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

  Powered by Linux