ceph: return error on fsc mount option on kernel without support
diff mbox series

Message ID 20191107140451.44991-1-jlayton@kernel.org
State New
Headers show
Series
  • ceph: return error on fsc mount option on kernel without support
Related show

Commit Message

Jeff Layton Nov. 7, 2019, 2:04 p.m. UTC
If the kernel was built without fscache support, then we should have it
return an error when someone attempts to mount with -o fsc. Also, prefix
the similar message with POSIX ACL support with "ceph:" to make it clear
which driver doesn't have that support.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/super.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index d68d6aad6d57..cdd3073acbac 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -373,6 +373,7 @@  static int ceph_parse_param(struct fs_context *fc, struct fs_parameter *param)
 		break;
 
 	case Opt_fscache:
+#ifdef CONFIG_CEPH_FSCACHE
 		kfree(fsopt->fscache_uniq);
 		fsopt->fscache_uniq = NULL;
 		if (result.negated) {
@@ -383,6 +384,9 @@  static int ceph_parse_param(struct fs_context *fc, struct fs_parameter *param)
 			param->string = NULL;
 		}
 		break;
+#else
+		return invalf(fc, "ceph: fscache support is disabled");
+#endif
 
 	case Opt_poolperm:
 		if (!result.negated)
@@ -413,7 +417,7 @@  static int ceph_parse_param(struct fs_context *fc, struct fs_parameter *param)
 #ifdef CONFIG_CEPH_FS_POSIX_ACL
 			fc->sb_flags |= SB_POSIXACL;
 #else
-			return invalf(fc, "POSIX ACL support is disabled");
+			return invalf(fc, "ceph: POSIX ACL support is disabled");
 #endif
 		} else {
 			fc->sb_flags &= ~SB_POSIXACL;