[LTP] [RFC] [PATCH] lib: Fix result propagation after exec() + tst_reinit()

Jan Stancek jstancek@redhat.com
Fri Aug 3 16:16:24 CEST 2018



----- Original Message -----
> Hi!
> > > and also adds a needs_ipc_path flag to
> > > tst_test structure, which causes the library not to unlink the IPC file
> > > after it has been mapped and also inserts LTP_IPC_PATH to the
> > > environment.
> > 
> > What is the negative of skipping unlink() for all tests?
> > Test itself runs in separate process, so cleanup_ipc() should run
> > anyway and clean it.
> 
> Well we use test ID as well as pid for the filename so it should be
> unique enough, we also do O_EXCL on the file so I guess that it should
> be safe enough not to unlink() it after it has been mapped.
> 
> There is one downside though, in a case that there is no tmpfs mounted
> we fall back to mapping a file, in which case we will trigger writeback
> to the storage by updating the piece of memory.
> 
> And given that there are actually very few testcases that needs to
> access the test library from the children started by exec I would like
> to keep unlinking the file unless needed.

OK, then let's go with new flag for tst_test struct.
As you said, it's not very commonly used.
Can you add a sentence or two also to docs part that talks about reinit?

Regards,
Jan

> 
> > .needs_ipc_path - I'm worried users won't know what this is for.
> > Maybe if it was called ".child_needs_reinit"? reinit appears
> > to be the only reason we need to keep shm_path around.
> 
> That sounds definitely better.
> 
> --
> Cyril Hrubis
> chrubis@suse.cz
> 


More information about the ltp mailing list