[CRIU] [PATCH 1/2] kerndat: check the lock field in fdinfo

Pavel Emelyanov xemul at parallels.com
Wed Apr 22 12:17:57 PDT 2015


> @@ -774,6 +792,8 @@ int check_add_feature(char *feat)
>  		chk_feature = check_tun;
>  	else if (!strcmp(feat, "userns"))
>  		chk_feature = check_userns;
> +	else if (!strcmp(feat, "lock"))

Just "lock" is too generic.

> +		chk_feature = check_fdinfo_lock;
>  	else {
>  		pr_err("Unknown feature %s\n", feat);
>  		return -1;
> diff --git a/include/kerndat.h b/include/kerndat.h
> index 12517d1..2134bb2 100644
> --- a/include/kerndat.h
> +++ b/include/kerndat.h
> @@ -13,6 +13,7 @@ struct stat;
>  extern int kerndat_init(void);
>  extern int kerndat_init_rst(void);
>  extern int kerndat_get_dirty_track(void);
> +extern int kerndat_fdinfo_has_lock(void);
>  
>  struct kerndat_s {
>  	dev_t shmem_dev;
> @@ -21,6 +22,7 @@ struct kerndat_s {
>  	u64 zero_page_pfn;
>  	bool has_dirty_track;
>  	bool has_memfd;
> +	bool has_lock;

The has_fdinfo_lock name is more informative.

>  };
>  
>  extern struct kerndat_s kdat;



More information about the CRIU mailing list