[CRIU] [RFC][PATCH] zdtm: Check that files from alien mnt ns are handled

Christopher Covington cov at codeaurora.org
Wed Jul 16 09:37:16 PDT 2014


Hi Pavel,

On 07/16/2014 06:29 AM, Pavel Emelyanov wrote:
> Check that files opened before switching to new mount namespace
> remain in it after restore. Right now this is not so :( Andrey is
> fixing the issue.
> 
> Christopher, can you check whether the ns_child's call to system()
> works in your minimal set-ups (it launches cat and awk). If not,
> then I should rewrite this routine in pure C.

I unfortunately have some more work to do before the namespace setup works in
my environment. I don't have an ldd on the target root filesystem. Maybe I can
perform that step during the build stage and cache the result for use by the
run stage.

> --- /dev/null
> +++ b/test/zdtm/live/static/mntns_open.c

> +	char *cmd_pat = "cat /proc/self/fdinfo/%d /proc/self/fdinfo/%d |"
> +			" awk 'BEGIN{p=0}/mnt_id:/{"
> +			" if (p == 0) { p = $2; } "
> +			" else if (p != $2) { exit " S(AWK_OK) " } "
> +			" else { exit " S(AWK_FAIL) " } }'";

Manual execution of this works with BusyBox v1.19.4.

/tmp # cat /proc/self/fdinfo/0 /proc/self/fdinfo/1 | \
  awk 'BEGIN{p=0}/mnt_id:/{
  if (p == 0) { p = $2; }
  else if (p != $2) { exit 13 }
  else { exit 42 } }' ; \
  echo $?
13

Thanks,
Christopher

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by the Linux Foundation.


More information about the CRIU mailing list