[LTP] [PATCH 1/2] tst_device: Print info about acquiring device

Wei Gao wegao@suse.com
Tue May 28 09:50:24 CEST 2024


On Tue, May 28, 2024 at 08:03:14AM +0200, Andrea Cervesato via ltp wrote:
> Hi!
> 
> Good idea
> 
> Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
  Reviewed-by: Wei Gao <wegao@suse.com>
> 
> On 5/27/24 22:28, Petr Vorel wrote:
> > Print how much space is being acquired. Also print hint on ENOSPC.
> > 
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> >   lib/tst_device.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/lib/tst_device.c b/lib/tst_device.c
> > index d659b54cf..635b39d08 100644
> > --- a/lib/tst_device.c
> > +++ b/lib/tst_device.c
> > @@ -289,8 +289,10 @@ const char *tst_acquire_loop_device(unsigned int size, const char *filename)
> >   {
> >   	unsigned int acq_dev_size = size ? size : DEV_SIZE_MB;
> > +	tst_resm(TINFO, "Acquiring loop device %u MB", acq_dev_size);
> >   	if (tst_prealloc_file(filename, 1024 * 1024, acq_dev_size)) {
> > -		tst_resm(TWARN | TERRNO, "Failed to create %s", filename);
> > +		tst_resm(TWARN | TERRNO, "Failed to create %s%s", filename,
> > +			 errno == ENOSPC ? " (not enough space in $TMPDIR?)" : "");
> >   		return NULL;
> >   	}
> 
> Andrea
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp


More information about the ltp mailing list