public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: return FIEMAP_EXTENT_UNKNOWN for delayed allocation extent
@ 2013-06-06 13:24 Jeff Liu
  2013-06-17 21:53 ` Ben Myers
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Liu @ 2013-06-06 13:24 UTC (permalink / raw)
  To: xfs

From: Jie Liu <jeff.liu@oracle.com>

For FIEMAP ioctl(2), if an extent is in delayed allocation
state, we need to return the FIEMAP_EXTENT_UNKNOWN flag except
the FIEMAP_EXTENT_DELALLOC because its data location is unknown.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
 fs/xfs/xfs_iops.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index d82efaa..53ddbdb 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -970,7 +970,8 @@ xfs_fiemap_format(
 	if (bmv->bmv_oflags & BMV_OF_PREALLOC)
 		fiemap_flags |= FIEMAP_EXTENT_UNWRITTEN;
 	else if (bmv->bmv_oflags & BMV_OF_DELALLOC) {
-		fiemap_flags |= FIEMAP_EXTENT_DELALLOC;
+		fiemap_flags |= (FIEMAP_EXTENT_DELALLOC |
+				 FIEMAP_EXTENT_UNKNOWN);
 		physical = 0;   /* no block yet */
 	}
 	if (bmv->bmv_oflags & BMV_OF_LAST)
-- 
1.7.9.5

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: return FIEMAP_EXTENT_UNKNOWN for delayed allocation extent
  2013-06-06 13:24 [PATCH] xfs: return FIEMAP_EXTENT_UNKNOWN for delayed allocation extent Jeff Liu
@ 2013-06-17 21:53 ` Ben Myers
  2013-06-18  2:25   ` Jeff Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Myers @ 2013-06-17 21:53 UTC (permalink / raw)
  To: Jeff Liu; +Cc: xfs

Hey Jeff,

On Thu, Jun 06, 2013 at 06:24:01AM -0700, Jeff Liu wrote:
> From: Jie Liu <jeff.liu@oracle.com>
> 
> For FIEMAP ioctl(2), if an extent is in delayed allocation
> state, we need to return the FIEMAP_EXTENT_UNKNOWN flag except
> the FIEMAP_EXTENT_DELALLOC because its data location is unknown.
> 
> Signed-off-by: Jie Liu <jeff.liu@oracle.com>

Looks fine.  Is there an email thread I can reference?

Reviewed-by: Ben Myers <bpm@sgi.com>

Thanks,
	Ben

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: return FIEMAP_EXTENT_UNKNOWN for delayed allocation extent
  2013-06-17 21:53 ` Ben Myers
@ 2013-06-18  2:25   ` Jeff Liu
  2013-06-19 19:31     ` Ben Myers
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Liu @ 2013-06-18  2:25 UTC (permalink / raw)
  To: Ben Myers; +Cc: xfs

Hi Ben,
On 06/18/2013 05:53 AM, Ben Myers wrote:

> Hey Jeff,
> 
> On Thu, Jun 06, 2013 at 06:24:01AM -0700, Jeff Liu wrote:
>> From: Jie Liu <jeff.liu@oracle.com>
>>
>> For FIEMAP ioctl(2), if an extent is in delayed allocation
>> state, we need to return the FIEMAP_EXTENT_UNKNOWN flag except
>> the FIEMAP_EXTENT_DELALLOC because its data location is unknown.
>>
>> Signed-off-by: Jie Liu <jeff.liu@oracle.com>
> 
> Looks fine.  Is there an email thread I can reference?

I can't found an email thread to verify that, but according to
the specification of fiemap interface in kernel doc:
Documentation/filesystems/fiemap.txt

* FIEMAP_EXTENT_UNKNOWN
The location of this extent is currently unknown. This may indicate
the data is stored on an inaccessible volume or that no storage has
been allocated for the file yet.

* FIEMAP_EXTENT_DELALLOC
  - This will also set FIEMAP_EXTENT_UNKNOWN. 
    ^^^^^ <-- so the unknown flags should be set as well.

Delayed allocation - while there is data for this extent, its
physical location has not been allocated yet.

Also, Btrfs did it.

Thanks,
-Jeff

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: return FIEMAP_EXTENT_UNKNOWN for delayed allocation extent
  2013-06-18  2:25   ` Jeff Liu
@ 2013-06-19 19:31     ` Ben Myers
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Myers @ 2013-06-19 19:31 UTC (permalink / raw)
  To: Jeff Liu; +Cc: xfs

Hey Jeff,

On Tue, Jun 18, 2013 at 10:25:58AM +0800, Jeff Liu wrote:
> On 06/18/2013 05:53 AM, Ben Myers wrote:
> > On Thu, Jun 06, 2013 at 06:24:01AM -0700, Jeff Liu wrote:
> >> From: Jie Liu <jeff.liu@oracle.com>
> >>
> >> For FIEMAP ioctl(2), if an extent is in delayed allocation
> >> state, we need to return the FIEMAP_EXTENT_UNKNOWN flag except
> >> the FIEMAP_EXTENT_DELALLOC because its data location is unknown.
> >>
> >> Signed-off-by: Jie Liu <jeff.liu@oracle.com>
> > 
> > Looks fine.  Is there an email thread I can reference?
> 
> I can't found an email thread to verify that, but according to
> the specification of fiemap interface in kernel doc:
> Documentation/filesystems/fiemap.txt
> 
> * FIEMAP_EXTENT_UNKNOWN
> The location of this extent is currently unknown. This may indicate
> the data is stored on an inaccessible volume or that no storage has
> been allocated for the file yet.
> 
> * FIEMAP_EXTENT_DELALLOC
>   - This will also set FIEMAP_EXTENT_UNKNOWN. 
>     ^^^^^ <-- so the unknown flags should be set as well.
> 
> Delayed allocation - while there is data for this extent, its
> physical location has not been allocated yet.

Thanks.  That's just what I needed.  Applied.

> Also, Btrfs did it.

Heh.  Must be right then!  ;)

Regards,
	Ben

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-19 19:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-06 13:24 [PATCH] xfs: return FIEMAP_EXTENT_UNKNOWN for delayed allocation extent Jeff Liu
2013-06-17 21:53 ` Ben Myers
2013-06-18  2:25   ` Jeff Liu
2013-06-19 19:31     ` Ben Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox