[PATCH 17/19] xfsprogs: disable truncating of files

Jan Tulak jtulak at redhat.com
Thu Apr 7 04:41:45 CDT 2016


On Wed, Apr 6, 2016 at 11:42 PM, Eric Sandeen <sandeen at sandeen.net> wrote:

> On 3/24/16 6:15 AM, jtulak at redhat.com wrote:
> > From: Jan Tulak <jtulak at redhat.com>
> >
> > Unify mkfs.xfs behaviour a bit and never truncate files. If the user
> > is trying to mkfs an existing file, we don't want to destroy anything
> > he did with the file before (sparse file, allocations...)
>
> Hm, I guess so ...  What motivated this change?  I see that it
> changes behavior, but I'm not sure what it unifies or fixes -
> can you explain more?
>
> Both, I think. The non-truncating is a new change, a fix of undesired side
effects, where user lost his changes to the file, like sparse file... The
rest should be unifying the behavior w.r.t. mkfs arguments. Do you think
that the O_TRUNC change should be a separate patch?


> > +     if (*isfile && statres != 0 && (no_size || no_name)) {
>
> statres !=0 doesn't imply ENOENT; it could be EACCES
> or several other errors.  You'd need to check errno to know
> for sure.
>
> ​Well, then I need to print two errors. One if the file doesn't exists,
but additional arguments will fix it, and one for other cases, where I will
print the specific error...

​Cheers,
Jan​



-- 
Jan Tulak
jtulak at redhat.com / jan at tulak.me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://oss.sgi.com/pipermail/xfs/attachments/20160407/136b6d2c/attachment.html>


More information about the xfs mailing list