Re: [PATCH 1/4] xfs_restore: refactor open-coded file creation code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux