[LTP] [PATCH] tst_fill_fs: enhance the filesystem filling routine

Li Wang liwang@redhat.com
Tue Nov 19 15:03:48 CET 2019


On Tue, Nov 19, 2019 at 7:07 PM Jan Stancek <jstancek@redhat.com> wrote:

>
>
> ----- Original Message -----
> > -             while (len) {
> > +             while (len >= fi.f_bsize) {
>
> Let's say f_bsize is 512, and len is 1023. We hit ENOSPC for 1023,
> len for next round is 511. Loop ends, but we never tried write with
> f_bsize or smaller value.
>
> I think we should try len < fi.f_bsize at least once.
>

Good point. At least for len = fi.f_bsize.


>
> >                       ret = write(fd, buf, MIN(len, sizeof(buf)));
> >
> >                       if (ret < 0) {
> > +                             if (errno == ENOSPC) {
> > +                                     len /= 2;
> > +                                     continue;
> > +                             }
>
> The return below (in original code) doesn't appear to be reachable now.
>

Yes, but it doesn't make much sense there, maybe we could remove that part
directly?

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20191119/e94973b4/attachment.htm>


More information about the ltp mailing list