Re: [PATCH 3/3] btrfs: set FS_SUPPORTS_SEEK_HOLE flag.

2015-04-27 Thread Christoph Hellwig
On Mon, Apr 27, 2015 at 03:41:33PM +1000, NeilBrown wrote:
> Are you sure about NFSv4.2?
> 
> I see that it *can* report holes, but is there any guarantee that if you
> create a new file and write only the 5th block, then READ_PLUS will reliably
> report that the first 4 block are holes??

FYI, I'm talking about SEEK here, not READ_PLUS but the issue is the
same.

> Because if it doesn't guarantee that, then NFSv4.2 doesn't fit the with the
> others where SEEK_HOLE reliable reports holes.
> On the other hand if NFSv4.2 *does* guarantee that then the current READ_PLUS
> server patches are broken because they just use vfs_llseek and assume that
> trust what it says.

There is no quality of implementation guarantee in NFS, just like there
isn't any in Linux.  It's very hard to have any hard guarantees without
leaking specific implementation details like a block size.

> It would be really nice if SEEK_{DATA,HOLE} either reported holes reliably or
> returned ENXIO, but I guess there was a goo reason not to do that.

It would hav been useful, but we went with the Solaris way of reporting
a giant hole.  Solaris at least has a pathconf value telling you if
real SEEK_{DATA,HOLE} are supported, but with Linus' hatred of that
syscall we only have a bad emulation in glibc that isn't of much help
here.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] btrfs: set FS_SUPPORTS_SEEK_HOLE flag.

2015-04-26 Thread NeilBrown
On Mon, 20 Apr 2015 02:48:55 -0700 Christoph Hellwig 
wrote:

> On Mon, Apr 20, 2015 at 10:46:49AM +0100, David Howells wrote:
> > NeilBrown  wrote:
> > 
> > > Missing patch 2 of the 3-patch series?
> > 
> > Yes. :-)
> > 
> > Do ext4 and xfs support this, do you know?
> 
> Yes.  As do f2fs, ocfs2, gfs2, ceph and NFSv4.2

Are you sure about NFSv4.2?

I see that it *can* report holes, but is there any guarantee that if you
create a new file and write only the 5th block, then READ_PLUS will reliably
report that the first 4 block are holes??

Because if it doesn't guarantee that, then NFSv4.2 doesn't fit the with the
others where SEEK_HOLE reliable reports holes.
On the other hand if NFSv4.2 *does* guarantee that then the current READ_PLUS
server patches are broken because they just use vfs_llseek and assume that
trust what it says.

It would be really nice if SEEK_{DATA,HOLE} either reported holes reliably or
returned ENXIO, but I guess there was a goo reason not to do that.

Thanks,
NeilBrown


pgpepP_eu_MoM.pgp
Description: OpenPGP digital signature


Re: [PATCH 3/3] btrfs: set FS_SUPPORTS_SEEK_HOLE flag.

2015-04-21 Thread Hugh Dickins
On Tue, 21 Apr 2015, Christoph Hellwig wrote:
> On Mon, Apr 20, 2015 at 01:58:35PM +0100, Al Viro wrote:
> > > > Do ext4 and xfs support this, do you know?
> > > 
> > > Yes.  As do f2fs, ocfs2, gfs2, ceph and NFSv4.2
> > 
> > Er...  Nominally, gfs2 supports it.  By treating all files as "there's a
> > hole starting at EOF".  Same as ext2 or even minix...
> 
> Yeah remove gfs2 from the list.

But please add tmpfs to the list -
though I doubt you're interested in caching its files.

Hugh
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] btrfs: set FS_SUPPORTS_SEEK_HOLE flag.

2015-04-21 Thread Christoph Hellwig
On Mon, Apr 20, 2015 at 01:58:35PM +0100, Al Viro wrote:
> > > Do ext4 and xfs support this, do you know?
> > 
> > Yes.  As do f2fs, ocfs2, gfs2, ceph and NFSv4.2
> 
> Er...  Nominally, gfs2 supports it.  By treating all files as "there's a
> hole starting at EOF".  Same as ext2 or even minix...

Yeah remove gfs2 from the list.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] btrfs: set FS_SUPPORTS_SEEK_HOLE flag.

2015-04-20 Thread Chris Mason
On 04/20/2015 01:27 AM, NeilBrown wrote:
> This allows fscache to cachefiles in a btrfs filesystem.

Thanks for working on this Neil.

Signed-off-by: Chris Mason 

-chris

> 
> Signed-off-by: NeilBrown 
> ---
>  fs/btrfs/super.c |3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 05fef198ff94..d3c5d2b40f8e 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -1904,7 +1904,8 @@ static struct file_system_type btrfs_fs_type = {
>   .name   = "btrfs",
>   .mount  = btrfs_mount,
>   .kill_sb= btrfs_kill_super,
> - .fs_flags   = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA,
> + .fs_flags   = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA |
> +   FS_SUPPORTS_SEEK_HOLE,
>  };
>  MODULE_ALIAS_FS("btrfs");
>  
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] btrfs: set FS_SUPPORTS_SEEK_HOLE flag.

2015-04-20 Thread Al Viro
On Mon, Apr 20, 2015 at 02:48:55AM -0700, Christoph Hellwig wrote:
> On Mon, Apr 20, 2015 at 10:46:49AM +0100, David Howells wrote:
> > NeilBrown  wrote:
> > 
> > > Missing patch 2 of the 3-patch series?
> > 
> > Yes. :-)
> > 
> > Do ext4 and xfs support this, do you know?
> 
> Yes.  As do f2fs, ocfs2, gfs2, ceph and NFSv4.2

Er...  Nominally, gfs2 supports it.  By treating all files as "there's a
hole starting at EOF".  Same as ext2 or even minix...
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] btrfs: set FS_SUPPORTS_SEEK_HOLE flag.

2015-04-20 Thread Christoph Hellwig
On Mon, Apr 20, 2015 at 10:46:49AM +0100, David Howells wrote:
> NeilBrown  wrote:
> 
> > Missing patch 2 of the 3-patch series?
> 
> Yes. :-)
> 
> Do ext4 and xfs support this, do you know?

Yes.  As do f2fs, ocfs2, gfs2, ceph and NFSv4.2

> 
> David
---end quoted text---
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] btrfs: set FS_SUPPORTS_SEEK_HOLE flag.

2015-04-20 Thread David Howells
NeilBrown  wrote:

> Missing patch 2 of the 3-patch series?

Yes. :-)

Do ext4 and xfs support this, do you know?

David
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] btrfs: set FS_SUPPORTS_SEEK_HOLE flag.

2015-04-20 Thread NeilBrown
On Mon, 20 Apr 2015 09:47:42 +0100 David Howells  wrote:

> NeilBrown  wrote:
> 
> > +   .fs_flags   = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA |
> > + FS_SUPPORTS_SEEK_HOLE,
> 
> I must be missing something:
> 
>   warthog>git merge linus/master
>   Already up-to-date.
>   warthog>stg id
>   09d51602cf84a1264946711dd4ea0dddbac599a1
>   warthog>grep -r FS_SUPPORTS_SEEK_HOLE include/
>   warthog1>git grep FS_SUPPORTS_SEEK_HOLE
>   warthog1>
> 

Missing patch 2 of the 3-patch series?

NeilBrown


pgpH8svVeTADM.pgp
Description: OpenPGP digital signature


Re: [PATCH 3/3] btrfs: set FS_SUPPORTS_SEEK_HOLE flag.

2015-04-20 Thread David Howells
NeilBrown  wrote:

> + .fs_flags   = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA |
> +   FS_SUPPORTS_SEEK_HOLE,

I must be missing something:

warthog>git merge linus/master
Already up-to-date.
warthog>stg id
09d51602cf84a1264946711dd4ea0dddbac599a1
warthog>grep -r FS_SUPPORTS_SEEK_HOLE include/
warthog1>git grep FS_SUPPORTS_SEEK_HOLE
warthog1>

David
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] btrfs: set FS_SUPPORTS_SEEK_HOLE flag.

2015-04-19 Thread NeilBrown
This allows fscache to cachefiles in a btrfs filesystem.

Signed-off-by: NeilBrown 
---
 fs/btrfs/super.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 05fef198ff94..d3c5d2b40f8e 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1904,7 +1904,8 @@ static struct file_system_type btrfs_fs_type = {
.name   = "btrfs",
.mount  = btrfs_mount,
.kill_sb= btrfs_kill_super,
-   .fs_flags   = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA,
+   .fs_flags   = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA |
+ FS_SUPPORTS_SEEK_HOLE,
 };
 MODULE_ALIAS_FS("btrfs");
 


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html