On Wed, Aug 24, 2011 at 08:05:56PM +0800, Takashi Iwai wrote:
Hi Takashi,
I don't how this approach can solve this problem.
There is no problem. You can't copy the data from ELEM_INFO for ELEM_ADD/REPLACE. It was a wrong assumption to reuse the data. Instead, you had to set up the struct field manually. That is, the test procedure was simply wrong.
There's still an implicit assumption here that user space application will clear info->elem_count to zero before it issues the REPLACE ioctl, right?
Yes, the point is that it's no longer same structure. So, you can't copy from the result from ELEM_INFO ioctl any more. Instead, you need to set up the struct field manually.
Thanks Takashi, that's the info I'm looking for. We need to state this requirements explicitly, it seems we lack these kind of documentation and thus it results in poorly written test cases in user space.
Is there any man pages or documentation we can state this clearly? I can help to contribute some documentation or even add some sample programs there.