xfs
[Top] [All Lists]

Re: [PATCH 0/2] Add FALLOC_FL_ZERO_RANGE to fallocate

To: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Subject: Re: [PATCH 0/2] Add FALLOC_FL_ZERO_RANGE to fallocate
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 14 Jun 2012 09:51:31 +1000
Cc: linux-kernel@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, Al Viro <viro@xxxxxxxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <4FD82F89.80106@xxxxxxxxxx>
References: <1339515364-17374-1-git-send-email-pbonzini@xxxxxxxxxx> <20120613013549.GO22848@dastard> <20120613033052.GT22848@dastard> <4FD82F89.80106@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Jun 13, 2012 at 08:13:29AM +0200, Paolo Bonzini wrote:
> Il 13/06/2012 05:30, Dave Chinner ha scritto:
> >> > 
> >> > Also, a minor nit, but you should credit where this code has
> >> > originated from in the commit messages, and describe the use case
> >> > for requiring it. i.e. based on:
> >> > 
> >> > http://permalink.gmane.org/gmane.linux.file-systems/62449
> 
> Interesting, I didn't know this---I wrote the code from scratch.
> 
> I took the description from the man pages ("This operation is a fast
> method of overwriting any from the range specified with zeros without
> removing any blocks or having to write zeros to disk"), so perhaps those
> will have to be patched as well.

The first line of the man page description is the important one:

$ man 3 xfsctl
.....
XFS_IOC_ZERO_RANGE
      This  command is used to convert a range of a file to zeros
      without issuing data IO. ....

The rest of the description is details about the implementation in
XFS, so users have some idea what to expect in terms or behaviour.
The line that you quoted:

        This operation is a fast method of overwriting any from the
        range specified with zeros without removing any blocks or
        having to write zeros to disk.

describes how the implementation is different from hole punching
(i.e XFS_IOC_UNRESVSP).  All the stuff about unwritten extents is
copied directly from the about XFS_IOC_RESVSP preallocation
description to provide consistent information in the man page.

The XFS_IOC_ZERO_RANGE man page is not a requirements specification
- it's user-level documentation. Yes, it describes the
implementation, but does not convey any of the reasons that the
functionality was implemented that way. Hence using that as the
requirements spec for equivalent fallocate functionality will miss
the mark...

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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