All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Andre Noll <maan@tuebingen.mpg.de>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/4] xfs_restore: refactor open-coded file creation code
Date: Fri, 22 Feb 2019 11:28:36 -0800	[thread overview]
Message-ID: <20190222192836.GB21626@magnolia> (raw)
In-Reply-To: <20190222192053.GF15048@tuebingen.mpg.de>

On Fri, Feb 22, 2019 at 08:20:53PM +0100, Andre Noll wrote:
> On Fri, Feb 22, 08:47, Darrick J. Wong wrote
> > +	ret = ioctl(fd, XFS_IOC_RESVSP64, &fl);
> > +	if (ret && errno != ENOTTY)
> > +		mlog(MLOG_VERBOSE | MLOG_NOTE,
> > +_("attempt to reserve %lld bytes for %s using %s failed: %s (%d)\n"),
> > +				size, pathname, "XFS_IOC_RESVSP64",
> > +				strerror(errno), errno);
> 
> The "XFS_IOC_RESVSP64" string literal can be included in the format string.

I was trying not to force an update of the i18n message catalogs.

> > +	if (ret == 0)
> > +		goto done;
> > +
> > +done:
> 
> LOL

Yes, it's silly, but gcc will complain if the label doesn't get
used, which it won't if you apply the rest of the series and build
xfsdump on a system that (somehow) doesn't know about fallocate.

> > +	return fd;
> 
> If you really want to return success even if the ioctl() failed, this might
> deserve a comment.

That's what the old code did, hence "try" in "try to reserve space" in
the comment describing what this function does.

--D

> 
> Andre
> -- 
> Max Planck Institute for Developmental Biology
> Max-Planck-Ring 5, 72076 Tübingen, Germany. Phone: (+49) 7071 601 829
> http://people.tuebingen.mpg.de/maan/

  reply	other threads:[~2019-02-22 19:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 16:47 [PATCH 0/4] xfsdump: update to use fallocate Darrick J. Wong
2019-02-22 16:47 ` [PATCH 1/4] xfs_restore: refactor open-coded file creation code Darrick J. Wong
2019-02-22 19:20   ` Andre Noll
2019-02-22 19:28     ` Darrick J. Wong [this message]
2019-02-22 19:55       ` Andre Noll
2019-05-07  0:11   ` Allison Collins
2019-05-20 21:05     ` Darrick J. Wong
2019-02-22 16:47 ` [PATCH 2/4] xfs_restore: check return value Darrick J. Wong
2019-05-07  0:11   ` Allison Collins
2019-02-22 16:47 ` [PATCH 3/4] xfs_restore: fix unsupported ioctl detection Darrick J. Wong
2019-05-07  0:11   ` Allison Collins
2019-02-22 16:47 ` [PATCH 4/4] xfs_restore: support fallocate when reserving space for a file Darrick J. Wong
2019-05-07  0:11   ` Allison Collins
2019-05-06 18:24 ` [PATCH 0/4] xfsdump: update to use fallocate Darrick J. Wong
2019-08-20 20:21 Darrick J. Wong
2019-08-20 20:21 ` [PATCH 1/4] xfs_restore: refactor open-coded file creation code Darrick J. Wong

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=20190222192836.GB21626@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=maan@tuebingen.mpg.de \
    /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.