Bug 1327857 - fallocate + punch_hole used instead of fallocate + zero_range in glfs_discard()
Summary: fallocate + punch_hole used instead of fallocate + zero_range in glfs_discard()
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: GlusterFS
Classification: Community
Component: fuse
Version: mainline
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Csaba Henk
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-16 23:54 UTC by Коренберг Марк
Modified: 2018-04-16 14:52 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-09-06 12:46:34 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Коренберг Марк 2016-04-16 23:54:29 UTC
primarily, problem happen with qemu with glusterfs backend. Since underlaying FS is ext4, when libglusterfs punches holes with FALLOC_FL_PUNCH_HOLE, it makes files heavy fragmented. Instead of this, FALLOC_FL_ZERO_RANG may be used. FALLOC_FL_ZERO_RANG must also pass discard requests to underlaying block device, so, feature used in qemu still be achieved.

1. Does FUSE allows to implement both fallocate cases ?
2. How does these cases handled in GlusterFS ? I mean usage through FUSE.
3. I suggest API change in order to able to handle both cases in libglusterfs.
4. QEMU glusterfs backend should be configurable how to pass discards from guest fs - using FALLOC_FL_ZERO_RANGE or FALLOC_FL_PUNCH_HOLE.

Please comment all 4 points.

Comment 1 Коренберг Марк 2016-04-16 23:56:48 UTC
Additional info about this subject: http://blog.gluster.org/category/unmap

Comment 2 Niels de Vos 2016-11-28 15:39:21 UTC
A related question came up on the mailinglist:
  http://www.gluster.org/pipermail/gluster-devel/2016-November/051610.html

(In reply to Коренберг Марк from comment #0)
> primarily, problem happen with qemu with glusterfs backend. Since
> underlaying FS is ext4, when libglusterfs punches holes with
> FALLOC_FL_PUNCH_HOLE, it makes files heavy fragmented. Instead of this,
> FALLOC_FL_ZERO_RANG may be used. FALLOC_FL_ZERO_RANG must also pass discard
> requests to underlaying block device, so, feature used in qemu still be
> achieved.
> 
> 1. Does FUSE allows to implement both fallocate cases ?

Yes, it seems so. At least we account for both flags in fuse-bridge.c:
  https://github.com/gluster/glusterfs/commit/17f28717

> 2. How does these cases handled in GlusterFS ? I mean usage through FUSE.

See https://github.com/gluster/glusterfs/commit/17f28717

> 3. I suggest API change in order to able to handle both cases in
> libglusterfs.

Can you be a bit more specific on the suggested change? Note that the protocol and functions in libgfapi should stay backwards compatible.

> 4. QEMU glusterfs backend should be configurable how to pass discards from
> guest fs - using FALLOC_FL_ZERO_RANGE or FALLOC_FL_PUNCH_HOLE.

This is something that we could add to the Gluster block-driver in QEMU.

Comment 3 Коренберг Марк 2016-11-28 16:27:21 UTC
I have lost interest to GlusterFS, sorry guys.

Comment 4 Csaba Henk 2017-09-06 12:46:34 UTC
OP's request is more open-ended than to be able to take action on it, and he lost interested in the problem. Moreover, it seems the problem spans QEMU & GlusterFS projects, so a mere GlusterFS bug is not the best way to capture it.


Note You need to log in before you can comment on or make changes to this bug.