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

1234567891011121314151617181920212223242526272829303132
  1. From 1ae92642e5900316011736072b4fa91710840620 Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <daniel@makrotopia.org>
  3. Date: Sat, 18 Jun 2016 17:53:45 +0200
  4. Subject: [PATCH] ubifs: Silence error output if MS_SILENT is set
  5. This change completes commit
  6. 90bea5a3f0 ("UBIFS: respect MS_SILENT mount flag")
  7. which already implements support for MS_SILENT except for that one
  8. error message which is still being displayed despite MS_SILENT being
  9. set. Suppress that error message as well in case MS_SILENT is set.
  10. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  11. [rw: massaged commit message]
  12. Signed-off-by: Richard Weinberger <richard@nod.at>
  13. ---
  14. fs/ubifs/super.c | 5 +++--
  15. 1 file changed, 3 insertions(+), 2 deletions(-)
  16. --- a/fs/ubifs/super.c
  17. +++ b/fs/ubifs/super.c
  18. @@ -2116,8 +2116,9 @@ static struct dentry *ubifs_mount(struct
  19. */
  20. ubi = open_ubi(name, UBI_READONLY);
  21. if (IS_ERR(ubi)) {
  22. - pr_err("UBIFS error (pid: %d): cannot open \"%s\", error %d",
  23. - current->pid, name, (int)PTR_ERR(ubi));
  24. + if (!(flags & MS_SILENT))
  25. + pr_err("UBIFS error (pid: %d): cannot open \"%s\", error %d",
  26. + current->pid, name, (int)PTR_ERR(ubi));
  27. return ERR_CAST(ubi);
  28. }