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

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

 



On Wed, Apr 6, 2016 at 11:42 PM, Eric Sandeen <sandeen@xxxxxxxxxxx> wrote:
On 3/24/16 6:15 AM, jtulak@xxxxxxxxxx wrote:
> From: Jan Tulak <jtulak@xxxxxxxxxx>
>
> 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​



--
_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs

[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux