[LTP] [PATCH v2 1/2] OVL_MNT: add setup_overlay helper

Murphy Zhou xzhou@redhat.com
Fri May 24 15:44:12 CEST 2019


Hi guys,

Very good ideas! Thank you both very much!

M
On Fri, May 24, 2019 at 02:23:57PM +0200, Petr Vorel wrote:
> Hi Amir,
> 
> thanks for your suggestions, highly appreciated :).
> ...
> > > #define SAFE_MOUNT_OVERLAY() \
> > >         mount_overlay(__FILE__, __LINE__, 1);
> 
> > > #define TST_MOUNT_OVERLAY() \
> > >         mount_overlay(__FILE__, __LINE__, 0);
> 
> 
> > I like this version of the helpers/macros.
> 
> > I would change TST_MOUNT_OVERLAY to
> > (mount_overlay(__FILE__, __LINE__, 0) == 0)
> > so that it could be used like this:
> 
> > ovl_mounted = TST_MOUNT_OVERLAY(...)
> +1
> 
> > Uses of SAFE_MOUNT_OVERLAY() should not check return value
> > could even place (void) in front of mount_overlay to enforce that.
> If we don't care, then it could be?
> #define SAFE_MOUNT_OVERLAY() \
> 	(void) mount_overlay(__FILE__, __LINE__, 1);
> 
> I mean there is always mount_overlay() for special cases, macros should be
> here to make easier common usage.
> 
> > Test that use SAFE_MOUNT_OVERLAY() should either have no
> > variable ovl_mounted or set it after SAFE_MOUNT_OVERLAY() without
> > checking return value.
> +1
> 
> > Thanks,
> > Amir.
> 
> Kind regards,
> Petr


More information about the ltp mailing list