* About reflink len = 0 behavior @ 2016-10-20 7:46 Qu Wenruo 2016-10-20 7:50 ` Qu Wenruo 0 siblings, 1 reply; 6+ messages in thread From: Qu Wenruo @ 2016-10-20 7:46 UTC (permalink / raw) To: Darrick J. Wong; +Cc: fstests, btrfs, xfs Hi Darrick, xfs guys and btrfs guys. Although such question is quite late as reflink generic tests are in fstests for a long time, I'm still not sure what's the correct behavior for reflink len = 0. Test case generic/182 is causing different output between btrfs and xfs. For btrfs, dedupe will just return 0 and check nothing, while for xfs len == 0 means to check the whole file length. Both makes sense for me, for btrfs len = 0 behavior, it just follows read/write functions. And I assume xfs follows reflink behavior, when len is not specified, then reflink the length of src file. But since it's a generic test, we need to unify the behavior. So, which one is the standard and which document should we follow for such behavior definition? Thanks, Qu ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About reflink len = 0 behavior 2016-10-20 7:46 About reflink len = 0 behavior Qu Wenruo @ 2016-10-20 7:50 ` Qu Wenruo 2016-10-20 15:47 ` Omar Sandoval 0 siblings, 1 reply; 6+ messages in thread From: Qu Wenruo @ 2016-10-20 7:50 UTC (permalink / raw) To: Darrick J. Wong; +Cc: fstests, btrfs, linux-xfs Add cc to new xfs mail list. At 10/20/2016 03:46 PM, Qu Wenruo wrote: > Hi Darrick, xfs guys and btrfs guys. > > Although such question is quite late as reflink generic tests are in > fstests for a long time, I'm still not sure what's the correct behavior > for reflink len = 0. > > Test case generic/182 is causing different output between btrfs and xfs. > > For btrfs, dedupe will just return 0 and check nothing, while for xfs > len == 0 means to check the whole file length. > > Both makes sense for me, for btrfs len = 0 behavior, it just follows > read/write functions. > And I assume xfs follows reflink behavior, when len is not specified, > then reflink the length of src file. > > But since it's a generic test, we need to unify the behavior. > > So, which one is the standard and which document should we follow for > such behavior definition? > > Thanks, > Qu > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About reflink len = 0 behavior 2016-10-20 7:50 ` Qu Wenruo @ 2016-10-20 15:47 ` Omar Sandoval 2016-10-21 3:00 ` Darrick J. Wong 0 siblings, 1 reply; 6+ messages in thread From: Omar Sandoval @ 2016-10-20 15:47 UTC (permalink / raw) To: Qu Wenruo; +Cc: Darrick J. Wong, fstests, btrfs, linux-xfs On Thu, Oct 20, 2016 at 03:50:46PM +0800, Qu Wenruo wrote: > Add cc to new xfs mail list. > > > At 10/20/2016 03:46 PM, Qu Wenruo wrote: > > Hi Darrick, xfs guys and btrfs guys. > > > > Although such question is quite late as reflink generic tests are in > > fstests for a long time, I'm still not sure what's the correct behavior > > for reflink len = 0. > > > > Test case generic/182 is causing different output between btrfs and xfs. > > > > For btrfs, dedupe will just return 0 and check nothing, while for xfs > > len == 0 means to check the whole file length. > > > > Both makes sense for me, for btrfs len = 0 behavior, it just follows > > read/write functions. > > And I assume xfs follows reflink behavior, when len is not specified, > > then reflink the length of src file. > > > > But since it's a generic test, we need to unify the behavior. > > > > So, which one is the standard and which document should we follow for > > such behavior definition? > > > > Thanks, > > Qu Hey, Qu, I brought this up a few months back here [1], and I think the conclusion was that consistency with clone (so the XFS behavior) was probably what we wanted. I just forgot to follow up and figure out if it would break any userspace programs in a way that mattered (I doubt it). 1: http://marc.info/?l=linux-btrfs&m=146828374631829&w=2 -- Omar ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About reflink len = 0 behavior 2016-10-20 15:47 ` Omar Sandoval @ 2016-10-21 3:00 ` Darrick J. Wong 2016-10-21 5:54 ` Qu Wenruo 2016-10-21 10:09 ` Christoph Hellwig 0 siblings, 2 replies; 6+ messages in thread From: Darrick J. Wong @ 2016-10-21 3:00 UTC (permalink / raw) To: Omar Sandoval; +Cc: Qu Wenruo, fstests, btrfs, linux-xfs On Thu, Oct 20, 2016 at 08:47:33AM -0700, Omar Sandoval wrote: > On Thu, Oct 20, 2016 at 03:50:46PM +0800, Qu Wenruo wrote: > > Add cc to new xfs mail list. > > > > > > At 10/20/2016 03:46 PM, Qu Wenruo wrote: > > > Hi Darrick, xfs guys and btrfs guys. > > > > > > Although such question is quite late as reflink generic tests are in > > > fstests for a long time, I'm still not sure what's the correct behavior > > > for reflink len = 0. "reflink to the end of the source file" is the current behavior for both. > > > Test case generic/182 is causing different output between btrfs and xfs. > > > > > > For btrfs, dedupe will just return 0 and check nothing, while for xfs > > > len == 0 means to check the whole file length. > > > > > > Both makes sense for me, for btrfs len = 0 behavior, it just follows > > > read/write functions. > > > And I assume xfs follows reflink behavior, when len is not specified, > > > then reflink the length of src file. Yes. > > > But since it's a generic test, we need to unify the behavior. > > > > > > So, which one is the standard and which document should we follow for > > > such behavior definition? <shrug> I suppose since it'll stop deduping at the first non-matching range, there's not a lot of point in having "dedupe to wherever is the end of the file" feature. (Also, if he hasn't already, I'm sure Christoph will point out that we shouldn't really go changing the interface after the fact, even if the interface was mostly undocumented and afaict not tested by anything like xfstests for years...) > > > Thanks, > > > Qu > > Hey, Qu, > > I brought this up a few months back here [1], and I think the conclusion > was that consistency with clone (so the XFS behavior) was probably what > we wanted. I just forgot to follow up and figure out if it would break > any userspace programs in a way that mattered (I doubt it). duperemove doesn't seem to send zero-byte dedupe requests. --D > > 1: http://marc.info/?l=linux-btrfs&m=146828374631829&w=2 > > -- > Omar ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About reflink len = 0 behavior 2016-10-21 3:00 ` Darrick J. Wong @ 2016-10-21 5:54 ` Qu Wenruo 2016-10-21 10:09 ` Christoph Hellwig 1 sibling, 0 replies; 6+ messages in thread From: Qu Wenruo @ 2016-10-21 5:54 UTC (permalink / raw) To: Darrick J. Wong, Omar Sandoval; +Cc: Qu Wenruo, fstests, btrfs, linux-xfs On 10/21/2016 11:00 AM, Darrick J. Wong wrote: > On Thu, Oct 20, 2016 at 08:47:33AM -0700, Omar Sandoval wrote: >> On Thu, Oct 20, 2016 at 03:50:46PM +0800, Qu Wenruo wrote: >>> Add cc to new xfs mail list. >>> >>> >>> At 10/20/2016 03:46 PM, Qu Wenruo wrote: >>>> Hi Darrick, xfs guys and btrfs guys. >>>> >>>> Although such question is quite late as reflink generic tests are in >>>> fstests for a long time, I'm still not sure what's the correct behavior >>>> for reflink len = 0. > > "reflink to the end of the source file" is the current behavior for both. > >>>> Test case generic/182 is causing different output between btrfs and xfs. >>>> >>>> For btrfs, dedupe will just return 0 and check nothing, while for xfs >>>> len == 0 means to check the whole file length. >>>> >>>> Both makes sense for me, for btrfs len = 0 behavior, it just follows >>>> read/write functions. >>>> And I assume xfs follows reflink behavior, when len is not specified, >>>> then reflink the length of src file. > > Yes. > >>>> But since it's a generic test, we need to unify the behavior. >>>> >>>> So, which one is the standard and which document should we follow for >>>> such behavior definition? > > <shrug> I suppose since it'll stop deduping at the first non-matching range, > there's not a lot of point in having "dedupe to wherever is the end of the > file" feature. > > (Also, if he hasn't already, I'm sure Christoph will point out that we > shouldn't really go changing the interface after the fact, even if the > interface was mostly undocumented and afaict not tested by anything like > xfstests for years...) Thanks for all the info. I think we should change btrfs behavior to follow the standard. > >>>> Thanks, >>>> Qu >> >> Hey, Qu, >> >> I brought this up a few months back here [1], and I think the conclusion >> was that consistency with clone (so the XFS behavior) was probably what >> we wanted. I just forgot to follow up and figure out if it would break >> any userspace programs in a way that mattered (I doubt it). > > duperemove doesn't seem to send zero-byte dedupe requests. Then no problem to modify btrfs behavior then. Thanks, Qu > > --D > >> >> 1: http://marc.info/?l=linux-btrfs&m=146828374631829&w=2 >> >> -- >> Omar > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About reflink len = 0 behavior 2016-10-21 3:00 ` Darrick J. Wong 2016-10-21 5:54 ` Qu Wenruo @ 2016-10-21 10:09 ` Christoph Hellwig 1 sibling, 0 replies; 6+ messages in thread From: Christoph Hellwig @ 2016-10-21 10:09 UTC (permalink / raw) To: Darrick J. Wong; +Cc: Omar Sandoval, Qu Wenruo, fstests, btrfs, linux-xfs On Thu, Oct 20, 2016 at 08:00:05PM -0700, Darrick J. Wong wrote: > > > > For btrfs, dedupe will just return 0 and check nothing, while for xfs > > > > len == 0 means to check the whole file length. > > > > > > > > Both makes sense for me, for btrfs len = 0 behavior, it just follows > > > > read/write functions. > > > > And I assume xfs follows reflink behavior, when len is not specified, > > > > then reflink the length of src file. > > Yes. > > > > > But since it's a generic test, we need to unify the behavior. > > > > > > > > So, which one is the standard and which document should we follow for > > > > such behavior definition? > > <shrug> I suppose since it'll stop deduping at the first non-matching range, > there's not a lot of point in having "dedupe to wherever is the end of the > file" feature. > > (Also, if he hasn't already, I'm sure Christoph will point out that we > shouldn't really go changing the interface after the fact, even if the > interface was mostly undocumented and afaict not tested by anything like > xfstests for years...) Yes, I'd prefer to stick to the btrfs behavior when XFS follow their existing interface, unlesss said interface is clearly acknodged to be broken by the original developers. Now a 0 len as whole file sounds very useful, but I would prefer to get an explicit buying from the btrfs crowd, and have btrfs implement it properly first. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-10-21 10:09 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-10-20 7:46 About reflink len = 0 behavior Qu Wenruo 2016-10-20 7:50 ` Qu Wenruo 2016-10-20 15:47 ` Omar Sandoval 2016-10-21 3:00 ` Darrick J. Wong 2016-10-21 5:54 ` Qu Wenruo 2016-10-21 10:09 ` Christoph Hellwig
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).