From nobody@FreeBSD.org  Tue Jul  1 18:11:33 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E9341065671
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  1 Jul 2008 18:11:33 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 2BD268FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  1 Jul 2008 18:11:33 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m61IBWZb022366
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 1 Jul 2008 18:11:32 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m61IBWk0022365;
	Tue, 1 Jul 2008 18:11:32 GMT
	(envelope-from nobody)
Message-Id: <200807011811.m61IBWk0022365@www.freebsd.org>
Date: Tue, 1 Jul 2008 18:11:32 GMT
From: Mateusz Guzik <mjguzik@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] mount ignores values returned by exec_mountprog and mount_fs
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         125154
>Category:       bin
>Synopsis:       [patch] mount(8) ignores values returned by exec_mountprog and mount_fs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    matteo
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 01 18:20:00 UTC 2008
>Closed-Date:    Sat Jun 19 04:47:49 UTC 2010
>Last-Modified:  Sat Jun 19 04:47:49 UTC 2010
>Originator:     Mateusz Guzik
>Release:        8.0-CURRENT
>Organization:
>Environment:
FreeBSD eternal 8.0-CURRENT FreeBSD 8.0-CURRENT #10: Tue Jul  1 19:18:19 CEST 2008     f@eternal:/usr/obj/usr/src/sys/ETERNAL  i386

>Description:
mount stores values returned by exec_mountprog and mount_fs in variable ret, but it always returns 0.
>How-To-Repeat:
For example one can try to mount msdosfs, while not having module to support it:

# mount -t msdosfs foo /mnt
mount_msdosfs: foo: : Operation not supported by device
# echo $?
0
>Fix:
Patch is attached.

Patch attached with submission follows:

--- sbin/mount/mount.c.orig	2008-07-01 19:51:05.000000000 +0200
+++ sbin/mount/mount.c	2008-07-01 19:58:21.000000000 +0200
@@ -574,11 +574,11 @@
 			putfsent(&sf);
 		else
 			prmount(&sf);
 	}
 
-	return (0);
+	return (ret);
 }
 
 void
 prmount(struct statfs *sfp)
 {


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: matteo 
State-Changed-When: Dom 31 Ago 2008 20:08:12 UTC 
State-Changed-Why:  
Committed to HEAD 


Responsible-Changed-From-To: freebsd-bugs->matteo 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Dom 31 Ago 2008 20:08:12 UTC 
Responsible-Changed-Why:  
Committed to HEAD 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125154 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/125154: commit references a PR
Date: Sun, 31 Aug 2008 20:08:35 +0000 (UTC)

 matteo      2008-08-31 20:08:05 UTC
 
   FreeBSD src repository
 
   Modified files:
     sbin/mount           mount.c 
   Log:
   SVN rev 182570 on 2008-08-31 20:08:05Z by matteo
   
   Don't return always 0. Return what we get from exec_mountprog or
   mount_fs.
   
   PR:             bin/125154
   MFC after:      1 day
   
   Revision  Changes    Path
   1.99      +1 -1      src/sbin/mount/mount.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/125154: commit references a PR
Date: Mon,  1 Sep 2008 08:37:31 +0000 (UTC)

 matteo      2008-09-01 08:37:13 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sbin/mount           mount.c 
   Log:
   SVN rev 182595 on 2008-09-01 08:37:13Z by matteo
   
   Don't return always 0. Return what we get from exec_mountprog or
   mount_fs.
   
   PR:             bin/125154
   
   Revision  Changes    Path
   1.96.2.2  +1 -1      src/sbin/mount/mount.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: linimon 
State-Changed-When: Sat Jun 19 04:47:31 UTC 2010 
State-Changed-Why:  
MFCed to 7; unlikely to be MFCed to 6 at this point. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125154 
>Unformatted:
