grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: [PATCH] return failure from grub-mount if fuse_main failed
Date: Sat,  9 Mar 2013 12:08:51 +0400	[thread overview]
Message-ID: <1362816531-2222-1-git-send-email-arvidjaar@gmail.com> (raw)

Currently there is no way to check that mount was successful. It caused
problem with os-prober which did not try kernel mount fallback.

Return value of fuse_init is currenty unused, but still it looks wrong
to always return success. In this case it should simply be void; if it
returns value, let value be correct.

Ref: https://bugzilla.novell.com/show_bug.cgi?id=802983

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>

---
 ChangeLog         |    5 +++++
 util/grub-mount.c |    5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3b4b3b4..bb9f431 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-09  Andrey Borzenkov <arvidjaar@gmail.com>
+
+	* util/grub-mount.c (fuse_init): Return error if fuse_main
+	failed.
+
 2013-03-07  Andrey Borzenkov <arvidjaar@gmail.com>
 
 	* grub-core/fs/iso9660.c (add_part): Remove always_inline attribute
diff --git a/util/grub-mount.c b/util/grub-mount.c
index d0ab6a2..1c59c59 100644
--- a/util/grub-mount.c
+++ b/util/grub-mount.c
@@ -407,7 +407,8 @@ fuse_init (void)
       return grub_errno;
     }
 
-  fuse_main (fuse_argc, fuse_args, &grub_opers, NULL);
+  if (fuse_main (fuse_argc, fuse_args, &grub_opers, NULL))
+    grub_error (GRUB_ERR_UNKNOWN_FS, "fuse_main failed");
 
   for (i = 0; i < num_disks; i++)
     {
@@ -427,7 +428,7 @@ fuse_init (void)
       grub_free (loop_name);
     }
 
-  return GRUB_ERR_NONE;
+  return grub_errno;
 }
 
 static struct argp_option options[] = {  
-- 
tg: (475ef5e..) bnc/802983 (depends on: master)


                 reply	other threads:[~2013-03-09  8:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362816531-2222-1-git-send-email-arvidjaar@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).