Commit 6ff7f4d5 authored by Amir Goldstein's avatar Amir Goldstein Committed by Yang Yingliang
Browse files

ovl: simplify ovl_same_sb() helper



mainline inclusion
from mainline-5.6-rc1
commit 0f831ec8
category: bugfix
bugzilla: 37632
CVE: NA

---------------------------

No code uses the sb returned from this helper, so make it retrun a boolean
and rename it to ovl_same_fs().

The xino mode is irrelevant when all layers are on same fs, so instead of
describing samefs with mode OVL_XINO_OFF, use a new xino_mode state, which
is 0 in the case of samefs, -1 in the case of xino=off and > 0 with xino
enabled.

Create a new helper ovl_same_dev(), to use instead of the common check for
(ovl_same_fs() || xinobits).

Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>

Conflicts:
	fs/overlayfs/overlayfs.h
	[ Non bugfix patch 1e92e307("ovl: abstract ovl_inode lock
	  with a helper") reconstructed code is not applied. ]
	fs/overlayfs/super.c
	[ Non bugfix patch 1bd0a3ae("ovl: use pr_fmt auto generate
	  prefix") reconstructed code is not applied. ]

Signed-off-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent d701cf73
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment