046-ubifs-silence-error-output-if-MS_SILENT-is-set.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 6da56ec248e48c9c78721f51528c178adec3b35b Mon Sep 17 00:00:00 2001
  2. In-Reply-To: <5765615E.5010409@nod.at>
  3. References: <5765615E.5010409@nod.at>
  4. From: Daniel Golle <daniel@makrotopia.org>
  5. Date: Sat, 18 Jun 2016 11:42:52 +0200
  6. Subject: [PATCH] ubifs: silence error output if MS_SILENT is set
  7. X-Patchwork-Id: 637491
  8. X-Patchwork-Delegate: richard.weinberger@gmail.com
  9. To: linux-mtd@lists.infradead.org
  10. Cc: Artem Bityutskiy <dedekind1@gmail.com>,
  11. Richard Weinberger <richard.weinberger@gmail.com>
  12. This change completes
  13. commit 90bea5a3f0bf680b87b90516f3c231997f4b8f3b
  14. which already implements support for MS_SILENT except for that one
  15. error message which is still being displayed despite MS_SILENT being
  16. set. Suppress that error message as well in case MS_SILENT is set.
  17. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  18. ---
  19. fs/ubifs/super.c | 5 +++--
  20. 1 file changed, 3 insertions(+), 2 deletions(-)
  21. --- a/fs/ubifs/super.c
  22. +++ b/fs/ubifs/super.c
  23. @@ -2107,8 +2107,9 @@ static struct dentry *ubifs_mount(struct
  24. */
  25. ubi = open_ubi(name, UBI_READONLY);
  26. if (IS_ERR(ubi)) {
  27. - pr_err("UBIFS error (pid: %d): cannot open \"%s\", error %d",
  28. - current->pid, name, (int)PTR_ERR(ubi));
  29. + if (!(flags & MS_SILENT))
  30. + pr_err("UBIFS error (pid: %d): cannot open \"%s\", error %d",
  31. + current->pid, name, (int)PTR_ERR(ubi));
  32. return ERR_CAST(ubi);
  33. }