2
0

047-ubifs-silence-early-error-if-MS_SILENT-is-set.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From dccbc9197d2c3614f2fd6811874e1d982e4415f0 Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <daniel@makrotopia.org>
  3. Date: Tue, 19 Jul 2016 00:26:55 +0200
  4. Subject: [PATCH] ubifs: Silence early error messages if MS_SILENT is set
  5. Probe-mounting a volume too small for UBIFS results in kernel log
  6. polution which might irritate users.
  7. Address this by silencing errors which may happen during boot if the
  8. rootfs is e.g. squashfs (and thus rather small) stored on a UBI volume.
  9. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  10. Signed-off-by: Richard Weinberger <richard@nod.at>
  11. ---
  12. fs/ubifs/super.c | 14 +++++++-------
  13. 1 file changed, 7 insertions(+), 7 deletions(-)
  14. --- a/fs/ubifs/super.c
  15. +++ b/fs/ubifs/super.c
  16. @@ -520,19 +520,19 @@ static int init_constants_early(struct u
  17. c->max_write_shift = fls(c->max_write_size) - 1;
  18. if (c->leb_size < UBIFS_MIN_LEB_SZ) {
  19. - ubifs_err(c, "too small LEBs (%d bytes), min. is %d bytes",
  20. - c->leb_size, UBIFS_MIN_LEB_SZ);
  21. + ubifs_errc(c, "too small LEBs (%d bytes), min. is %d bytes",
  22. + c->leb_size, UBIFS_MIN_LEB_SZ);
  23. return -EINVAL;
  24. }
  25. if (c->leb_cnt < UBIFS_MIN_LEB_CNT) {
  26. - ubifs_err(c, "too few LEBs (%d), min. is %d",
  27. - c->leb_cnt, UBIFS_MIN_LEB_CNT);
  28. + ubifs_errc(c, "too few LEBs (%d), min. is %d",
  29. + c->leb_cnt, UBIFS_MIN_LEB_CNT);
  30. return -EINVAL;
  31. }
  32. if (!is_power_of_2(c->min_io_size)) {
  33. - ubifs_err(c, "bad min. I/O size %d", c->min_io_size);
  34. + ubifs_errc(c, "bad min. I/O size %d", c->min_io_size);
  35. return -EINVAL;
  36. }
  37. @@ -543,8 +543,8 @@ static int init_constants_early(struct u
  38. if (c->max_write_size < c->min_io_size ||
  39. c->max_write_size % c->min_io_size ||
  40. !is_power_of_2(c->max_write_size)) {
  41. - ubifs_err(c, "bad write buffer size %d for %d min. I/O unit",
  42. - c->max_write_size, c->min_io_size);
  43. + ubifs_errc(c, "bad write buffer size %d for %d min. I/O unit",
  44. + c->max_write_size, c->min_io_size);
  45. return -EINVAL;
  46. }