xfs
[Top] [All Lists]

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

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 17/19] xfsprogs: disable truncating of files
From: Jan Tulak <jtulak@xxxxxxxxxx>
Date: Thu, 14 Apr 2016 14:31:53 +0200
Cc: Eric Sandeen <sandeen@xxxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160413213758.GR567@dastard>
References: <1458818136-56043-1-git-send-email-jtulak@xxxxxxxxxx> <1458818136-56043-18-git-send-email-jtulak@xxxxxxxxxx> <20160408000910.GB21804@dastard> <CACj3i73f_v=70pGrrLkRpHB-6UwiOOM2F9Sbu2aZMaJGmBLeiQ@xxxxxxxxxxxxxx> <20160408230843.GE567@dastard> <CACj3i71Grs8deYRtTaGmTmgBTrge-VKQKpn1Azj_y8=KQHWbgg@xxxxxxxxxxxxxx> <570E7129.3080900@xxxxxxxxxxx> <20160413213758.GR567@dastard>
On Wed, Apr 13, 2016 at 11:37 PM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
On Wed, Apr 13, 2016 at 11:17:45AM -0500, Eric Sandeen wrote:
> On 4/13/16 10:08 AM, Jan Tulak wrote:
>
> ...
>
> > All rightâ, I will keep the O_TRUNC there. However, should it
> > truncate the file every time, or should we offer a way how to avoid
> > the file truncating? Until now, mkfs behaved differently based on
> > whether -d file was given, or not. Your explanation suggests that we
> > should truncate every time, right?
>
> There are probably valid reasons to keep size as well as to truncate;
> it's not immediately clear to me how we should handle it.

That's easy: don't specify -dfile or -dsize, and instead let mkfs
detect that it is file automatically. Because it's not given a size,
or that it's supposed to be a file, it should not attempt to change
the "device" in any way.

When block devices grow fallocate support, we can unify the discard
behaviour to be a hole punch, and then it will work identically on
devices and files treated this way.

> Honestly, at this point, in the interest of getting the other fixes in,
> I think I might rather see the truncating behavior unchanged from what
> we have today; we can tackle that as a separate problem at a later date.

Yup, don't change it in this patch series.


Looking on this patch again, I think that it can be removed entirely. After reverting the O_CREATE part, the only thing it does is differentiating error messages between files and block devices, which is not worth of a patch.

Cheers,
Jan

--
<Prev in Thread] Current Thread [Next in Thread>