All of lore.kernel.org
 help / color / mirror / Atom feed
From: Coly Li <coyli@suse.de>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2-tools: add error message to mount.ocfs2 when mount point is invalid.
Date: Fri, 01 Aug 2008 09:29:34 +0800	[thread overview]
Message-ID: <489266FE.2080501@suse.de> (raw)
In-Reply-To: <20080731200056.GC14766@mail.oracle.com>



Joel Becker Wrote:
> On Thu, Jul 31, 2008 at 09:40:21PM +0800, Coly Li wrote:
>> diff --git a/mount.ocfs2/mount.ocfs2.c b/mount.ocfs2/mount.ocfs2.c
>> index a97b4cb..eb8e336 100644
>> --- a/mount.ocfs2/mount.ocfs2.c
>> +++ b/mount.ocfs2/mount.ocfs2.c
>> @@ -382,9 +382,21 @@ int main(int argc, char **argv)
>>   			o2cb_complete_group_join(&cluster, &desc, errno);
>>   		}
>>   		block_signals (SIG_UNBLOCK);
>> -		com_err(progname, ret, "while mounting %s on %s. "
>> -			"Check 'dmesg' for more information on this error.",
>> -			mo.dev, mo.dir);
>> +
>> +		/* complain mount failure */
>> +		if (lstat(mo.dir, &statbuf))
>> +			com_err(progname, 0, "mount point %s does not "
>> +				"exist", mo.dir);
>> +		else if (stat(mo.dir, &statbuf))
>> +			com_err(progname, 0, "mount point %s is a "
>> +				"symbolic link to nowhere", mo.dir);
>> +		else if (stat(mo.dir, &statbuf) || !S_ISDIR(statbuf.st_mode))
>   +		else if (!S_ISDIR(statbuf.st_mode))
> 
> 	You successfully called stat in the previous "else if" clause.
wow, thanks for catching this :)

> 
>> +			com_err(progname, 0, "mount point %s is not "
>> +				"a directory", mo.dir);
>> +		else
>> +			com_err(progname, ret, "while mounting %s on %s. "
>> +				"Check 'dmesg' for more information on this "
>> +				"error.", mo.dev, mo.dir);
> 
> 	Also, I agree with sunil's "broken symbolic link" text.
patch modified and resend to ocfs2-tools-devel again.

-- 
Coly Li
SuSE PRC Labs

      reply	other threads:[~2008-08-01  1:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31 13:40 [Ocfs2-devel] [PATCH] ocfs2-tools: add error message to mount.ocfs2 when mount point is invalid Coly Li
2008-07-31 17:44 ` Sunil Mushran
2008-07-31 20:00 ` Joel Becker
2008-08-01  1:29   ` Coly Li [this message]

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=489266FE.2080501@suse.de \
    --to=coyli@suse.de \
    --cc=ocfs2-devel@oss.oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.