From 1ae92642e5900316011736072b4fa91710840620 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 18 Jun 2016 17:53:45 +0200 Subject: ubifs: Silence error output if MS_SILENT is set This change completes commit 90bea5a3f0 ("UBIFS: respect MS_SILENT mount flag") which already implements support for MS_SILENT except for that one error message which is still being displayed despite MS_SILENT being set. Suppress that error message as well in case MS_SILENT is set. Signed-off-by: Daniel Golle [rw: massaged commit message] Signed-off-by: Richard Weinberger --- fs/ubifs/super.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs') diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 70349954e78b..736dd5842f46 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -2108,8 +2108,9 @@ static struct dentry *ubifs_mount(struct file_system_type *fs_type, int flags, */ ubi = open_ubi(name, UBI_READONLY); if (IS_ERR(ubi)) { - pr_err("UBIFS error (pid: %d): cannot open \"%s\", error %d", - current->pid, name, (int)PTR_ERR(ubi)); + if (!(flags & MS_SILENT)) + pr_err("UBIFS error (pid: %d): cannot open \"%s\", error %d", + current->pid, name, (int)PTR_ERR(ubi)); return ERR_CAST(ubi); } -- cgit v1.2.3-59-g8ed1b From dfaf8d2aeca4822e104fb3c4890d7b4b42048229 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 21 Jun 2016 17:50:43 +0100 Subject: ubifs: Make xattr structures static Fix sparse warnings from the use of "struct xattr_handler" structures that are not exported by making them static. Fixes the following sparse warnings: /fs/ubifs/xattr.c:595:28: warning: symbol 'ubifs_user_xattr_handler' was not declared. Should it be static? /fs/ubifs/xattr.c:601:28: warning: symbol 'ubifs_trusted_xattr_handler' was not declared. Should it be static? /fs/ubifs/xattr.c:607:28: warning: symbol 'ubifs_security_xattr_handler' was not declared. Should it be static? Signed-off-by: Ben Dooks Signed-off-by: Richard Weinberger --- fs/ubifs/xattr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fs') diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index b5fc27969e9d..e237811f09ce 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c @@ -592,19 +592,19 @@ static int ubifs_xattr_set(const struct xattr_handler *handler, return __ubifs_removexattr(inode, name); } -const struct xattr_handler ubifs_user_xattr_handler = { +static const struct xattr_handler ubifs_user_xattr_handler = { .prefix = XATTR_USER_PREFIX, .get = ubifs_xattr_get, .set = ubifs_xattr_set, }; -const struct xattr_handler ubifs_trusted_xattr_handler = { +static const struct xattr_handler ubifs_trusted_xattr_handler = { .prefix = XATTR_TRUSTED_PREFIX, .get = ubifs_xattr_get, .set = ubifs_xattr_set, }; -const struct xattr_handler ubifs_security_xattr_handler = { +static const struct xattr_handler ubifs_security_xattr_handler = { .prefix = XATTR_SECURITY_PREFIX, .get = ubifs_xattr_get, .set = ubifs_xattr_set, -- cgit v1.2.3-59-g8ed1b From 380bc8b71081a258a4cda0060803bfde47dd8c60 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 25 Jul 2016 13:44:50 +0200 Subject: ubifs: Update comment for ubifs_errc Signed-off-by: Daniel Golle Signed-off-by: Richard Weinberger --- fs/ubifs/ubifs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs') diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index ddf9f6b9eee2..4617d459022a 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -1783,8 +1783,8 @@ void ubifs_err(const struct ubifs_info *c, const char *fmt, ...); __printf(2, 3) void ubifs_warn(const struct ubifs_info *c, const char *fmt, ...); /* - * A variant of 'ubifs_err()' which takes the UBIFS file-sytem description - * object as an argument. + * A conditional variant of 'ubifs_err()' which doesn't output anything + * if probing (ie. MS_SILENT set). */ #define ubifs_errc(c, fmt, ...) \ do { \ -- cgit v1.2.3-59-g8ed1b From dccbc9197d2c3614f2fd6811874e1d982e4415f0 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 19 Jul 2016 00:26:55 +0200 Subject: ubifs: Silence early error messages if MS_SILENT is set Probe-mounting a volume too small for UBIFS results in kernel log polution which might irritate users. Address this by silencing errors which may happen during boot if the rootfs is e.g. squashfs (and thus rather small) stored on a UBI volume. Signed-off-by: Daniel Golle Signed-off-by: Richard Weinberger --- fs/ubifs/super.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'fs') diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 736dd5842f46..4ec051089186 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -520,19 +520,19 @@ static int init_constants_early(struct ubifs_info *c) c->max_write_shift = fls(c->max_write_size) - 1; if (c->leb_size < UBIFS_MIN_LEB_SZ) { - ubifs_err(c, "too small LEBs (%d bytes), min. is %d bytes", - c->leb_size, UBIFS_MIN_LEB_SZ); + ubifs_errc(c, "too small LEBs (%d bytes), min. is %d bytes", + c->leb_size, UBIFS_MIN_LEB_SZ); return -EINVAL; } if (c->leb_cnt < UBIFS_MIN_LEB_CNT) { - ubifs_err(c, "too few LEBs (%d), min. is %d", - c->leb_cnt, UBIFS_MIN_LEB_CNT); + ubifs_errc(c, "too few LEBs (%d), min. is %d", + c->leb_cnt, UBIFS_MIN_LEB_CNT); return -EINVAL; } if (!is_power_of_2(c->min_io_size)) { - ubifs_err(c, "bad min. I/O size %d", c->min_io_size); + ubifs_errc(c, "bad min. I/O size %d", c->min_io_size); return -EINVAL; } @@ -543,8 +543,8 @@ static int init_constants_early(struct ubifs_info *c) if (c->max_write_size < c->min_io_size || c->max_write_size % c->min_io_size || !is_power_of_2(c->max_write_size)) { - ubifs_err(c, "bad write buffer size %d for %d min. I/O unit", - c->max_write_size, c->min_io_size); + ubifs_errc(c, "bad write buffer size %d for %d min. I/O unit", + c->max_write_size, c->min_io_size); return -EINVAL; } -- cgit v1.2.3-59-g8ed1b From 13cd091364111508cc001aa66b5285fefe7cdd73 Mon Sep 17 00:00:00 2001 From: Sylvain Etienne Date: Thu, 23 Jun 2016 07:53:44 +0200 Subject: ubifs: switch_gc_head: Remove redondant sync of wbuf The wbuf is already sync-ed before ubifs_leb_unmap() Signed-off-by: Sylvain Etienne Acked-by: Artem Bityutskiy Signed-off-by: Richard Weinberger --- fs/ubifs/gc.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'fs') diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c index 9718da86ad01..821b34816976 100644 --- a/fs/ubifs/gc.c +++ b/fs/ubifs/gc.c @@ -100,10 +100,6 @@ static int switch_gc_head(struct ubifs_info *c) if (err) return err; - err = ubifs_wbuf_sync_nolock(wbuf); - if (err) - return err; - err = ubifs_add_bud_to_log(c, GCHD, gc_lnum, 0); if (err) return err; -- cgit v1.2.3-59-g8ed1b