diff options
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index b30c003b47d1..76e1ee5d03ed 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -2417,8 +2417,21 @@ static int nfs_bdi_register(struct nfs_server *server) | |||
2417 | int nfs_set_sb_security(struct super_block *s, struct dentry *mntroot, | 2417 | int nfs_set_sb_security(struct super_block *s, struct dentry *mntroot, |
2418 | struct nfs_mount_info *mount_info) | 2418 | struct nfs_mount_info *mount_info) |
2419 | { | 2419 | { |
2420 | return security_sb_set_mnt_opts(s, &mount_info->parsed->lsm_opts, | 2420 | int error; |
2421 | 0, NULL); | 2421 | unsigned long kflags = 0, kflags_out = 0; |
2422 | if (NFS_SB(s)->caps & NFS_CAP_SECURITY_LABEL) | ||
2423 | kflags |= SECURITY_LSM_NATIVE_LABELS; | ||
2424 | |||
2425 | error = security_sb_set_mnt_opts(s, &mount_info->parsed->lsm_opts, | ||
2426 | kflags, &kflags_out); | ||
2427 | if (error) | ||
2428 | goto err; | ||
2429 | |||
2430 | if (NFS_SB(s)->caps & NFS_CAP_SECURITY_LABEL && | ||
2431 | !(kflags_out & SECURITY_LSM_NATIVE_LABELS)) | ||
2432 | NFS_SB(s)->caps &= ~NFS_CAP_SECURITY_LABEL; | ||
2433 | err: | ||
2434 | return error; | ||
2422 | } | 2435 | } |
2423 | EXPORT_SYMBOL_GPL(nfs_set_sb_security); | 2436 | EXPORT_SYMBOL_GPL(nfs_set_sb_security); |
2424 | 2437 | ||