[CRIU] [PATCH 9/9] sk-unix: Don't fail if socket path lays on btrfs volume

Pavel Emelyanov xemul at parallels.com
Tue Dec 3 10:36:23 PST 2013


On 12/03/2013 07:58 PM, Cyrill Gorcunov wrote:
> 
> Because socket migh lay on btrfs volume (thus the device
> number reported by diag module won't be the same as obtained
> from stat(2)) we need to do an additional test and try
> to resolve device number with help of btrfs engine.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  sk-unix.c | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 


> @@ -354,8 +356,21 @@ static int unix_collect_one(const struct unix_diag_msg *m,
>  				goto skip;
>  			}
>  
> +			/*
> +			 * BTRFS is know to have own device numbering
> +			 * on subvolumes different from ones returned
> +			 * by diag module in kernel. Thus if device
> +			 * is different -- lookup if we can workaround
> +			 * this problem.
> +			 */
> +			udiag_vfs_dev = kdev_to_odev(uv->udiag_vfs_dev);
> +			if (st.st_dev != kdev_to_odev(uv->udiag_vfs_dev)) {

if (st.st_dev != udiag_vfs_dev) {

> +				if (btrfs_try_demangle(&st.st_dev, udiag_vfs_dev))
> +					goto err;
> +			}
> +
>  			if ((st.st_ino != uv->udiag_vfs_ino) ||
> -			    (st.st_dev != kdev_to_odev(uv->udiag_vfs_dev))) {
> +			    (st.st_dev != udiag_vfs_dev)) {
>  				pr_info("unix: Dropping path %s for "
>  						"unlinked bound "
>  						"sk %#x.%#x real %#x.%#x\n",


More information about the CRIU mailing list