Check get_exec_env() for !CONFIG_VE case.

https://virtuozzo.atlassian.net/browse/VSTOR-130116

Feature: !CONFIG_VE build
Signed-off-by: Vladimir Riabchun <[email protected]>
---
 fs/nfsd/nfsctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index c48d76402a72..e6ec3341b40e 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -1417,7 +1417,7 @@ static const struct fs_context_operations 
nfsd_fs_context_ops = {
 
 static int nfsd_init_fs_context(struct fs_context *fc)
 {
-       if (!(get_exec_env()->features & VE_FEATURE_NFSD))
+       if (!(get_exec_env() && get_exec_env()->features & VE_FEATURE_NFSD))
                return -ENODEV;
 
        put_user_ns(fc->user_ns);
-- 
2.47.1

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to