Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2018-05-17 08:30:02 +0200
committerJiri Kosina <jkosina@suse.cz>2018-05-17 08:30:02 +0200
commit8bfc6ccd93cdc4407343e3c4c3a9649aca614a3b (patch)
treea8993b656f1050db731009f7e7258b60169fec16
parenta8b28767e7e3c1341568b932c2fe507a7624771e (diff)
parent421855cee8b7a721230f42c36c05ac5cdc23a098 (diff)
Merge branch 'SLE15' into SLE12-SP4
Conflicts: series.conf suse-commit: a2d33a656f2d9d967d57ee5d5dfc16f4e0c1b760
-rw-r--r--arch/powerpc/sysdev/xive/spapr.c5
-rw-r--r--fs/reiserfs/super.c26
-rw-r--r--include/linux/unsupported-feature.h10
-rw-r--r--kernel/unsupported-feature.c14
4 files changed, 51 insertions, 4 deletions
diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
index 97ea0a67a173..575db3b06a6b 100644
--- a/arch/powerpc/sysdev/xive/spapr.c
+++ b/arch/powerpc/sysdev/xive/spapr.c
@@ -128,10 +128,9 @@ static unsigned int plpar_busy_delay(int rc)
{
unsigned int ms;
- might_sleep();
ms = plpar_busy_delay_time(rc);
- if (ms && need_resched())
- msleep(ms);
+ if (ms)
+ mdelay(ms);
return ms;
}
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 4bb7ac03fe14..32d9fce1a282 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -30,6 +30,26 @@
#include <linux/namei.h>
#include <linux/crc32.h>
#include <linux/seq_file.h>
+#include <linux/moduleparam.h>
+#include <linux/unsupported-feature.h>
+
+DECLARE_SUSE_UNSUPPORTED_FEATURE(reiserfs)
+DEFINE_SUSE_UNSUPPORTED_FEATURE(reiserfs)
+
+static bool check_rw_mount(struct super_block *sb, unsigned long flags)
+{
+ if (flags & MS_RDONLY)
+ return true;
+
+ if (reiserfs_allow_unsupported()) {
+ reiserfs_mark_unsupported();
+ return true;
+ }
+
+ pr_warn("reiserfs: read-write mode is unsupported.\n");
+ pr_warn("reiserfs: load module with allow_unsupported=1 to enable read-write mode.\n");
+ return false;
+}
struct file_system_type reiserfs_fs_type;
@@ -1450,6 +1470,9 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
int i;
#endif
+ if (!check_rw_mount(s, *mount_flags))
+ return -EACCES;
+
new_opts = kstrdup(arg, GFP_KERNEL);
if (arg && !new_opts)
return -ENOMEM;
@@ -1916,6 +1939,9 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
char *qf_names[REISERFS_MAXQUOTAS] = {};
unsigned int qfmt = 0;
+ if (!check_rw_mount(s, s->s_flags))
+ return -EACCES;
+
save_mount_options(s, data);
sbi = kzalloc(sizeof(struct reiserfs_sb_info), GFP_KERNEL);
diff --git a/include/linux/unsupported-feature.h b/include/linux/unsupported-feature.h
index faaa26971311..0ee9847ed13e 100644
--- a/include/linux/unsupported-feature.h
+++ b/include/linux/unsupported-feature.h
@@ -13,12 +13,19 @@ static inline bool suse_allow_unsupported(struct unsupported_feature *uf)
}
extern struct kernel_param_ops suse_allow_unsupported_param_ops;
+void suse_mark_unsupported(const struct unsupported_feature *uf,
+ struct module *module);
#define DECLARE_SUSE_UNSUPPORTED_FEATURE(name) \
extern struct unsupported_feature name ##__allow_unsupported; \
static inline bool name ## _allow_unsupported(void) \
{ \
return suse_allow_unsupported(&name ##__allow_unsupported); \
+} \
+ \
+static inline void name ## _mark_unsupported(void) \
+{ \
+ suse_mark_unsupported(&name ##__allow_unsupported, THIS_MODULE); \
}
#define DEFINE_SUSE_UNSUPPORTED_FEATURE(name) \
@@ -33,7 +40,8 @@ MODULE_PARM_DESC(allow_unsupported, \
#else
#define DECLARE_SUSE_UNSUPPORTED_FEATURE(name) \
-static inline bool name ## _allow_unsupported(void) { return true; }
+static inline bool name ## _allow_unsupported(void) { return true; } \
+static inline void name ## _mark_unsupported(void) { }
#define DEFINE_SUSE_UNSUPPORTED_FEATURE(name)
#endif
diff --git a/kernel/unsupported-feature.c b/kernel/unsupported-feature.c
index 9c7513379f7a..463685971477 100644
--- a/kernel/unsupported-feature.c
+++ b/kernel/unsupported-feature.c
@@ -49,3 +49,17 @@ struct kernel_param_ops suse_allow_unsupported_param_ops = {
.get = suse_get_allow_unsupported,
};
EXPORT_SYMBOL_GPL(suse_allow_unsupported_param_ops);
+
+/* including above breaks kABI due to struct module becoming defined */
+#include <linux/module.h>
+
+void suse_mark_unsupported(const struct unsupported_feature *uf,
+ struct module *module)
+{
+ if (module && !test_and_set_bit(TAINT_NO_SUPPORT, &module->taints))
+ pr_warn("%s: marking %s unsupported\n",
+ uf->subsys_name, module_name(module));
+}
+EXPORT_SYMBOL_GPL(suse_mark_unsupported);
+
+