From: Eric Sandeen <sandeen@sandeen.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] mkfs.xfs: fix fd validity check in get_topology
Date: Sat, 30 Jan 2010 14:46:56 -0600 [thread overview]
Message-ID: <4B649AC0.2040105@sandeen.net> (raw)
In-Reply-To: <20100130195226.GA15379@infradead.org>
Christoph Hellwig wrote:
> Only negatie return values from open mean we failed to open the device.
> Without this check we do not print the usage message when no device is
> specified. This leads to a weird failure in xfstests 122.
and unhelpful help for any user... argh :(
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.ent>
>
> Index: xfsprogs-dev/mkfs/xfs_mkfs.c
> ===================================================================
> --- xfsprogs-dev.orig/mkfs/xfs_mkfs.c 2010-01-30 20:44:03.505255109 +0100
> +++ xfsprogs-dev/mkfs/xfs_mkfs.c 2010-01-30 20:44:20.579255807 +0100
> @@ -455,7 +455,7 @@ static void get_topology(libxfs_init_t *
> &ft->dsunit, &ft->dswidth, &ft->sectoralign);
> fd = open(dfile, O_RDONLY);
> /* If this fails we just fall back to BBSIZE */
> - if (fd) {
> + if (fd >= 0) {
> platform_findsizes(dfile, fd, &dummy, &bsz);
> close(fd);
> }
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2010-01-30 20:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-30 19:52 [PATCH] mkfs.xfs: fix fd validity check in get_topology Christoph Hellwig
2010-01-30 20:46 ` Eric Sandeen [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=4B649AC0.2040105@sandeen.net \
--to=sandeen@sandeen.net \
--cc=hch@infradead.org \
--cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox