Skip to contentSkip to conversation

XATTRs in NFS?

DISCUSSION Christoph Anton Mitterer 15 participants 67 messages Oct 23, 2013 – Oct 31, 2013 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi.

I just wondered about the current situation (respectively plans) regarding XATTRs in NFS (I personally don't care much about the version,... of course v4 would be nice, but v3 should do either).

I'm aware about the patches for v3 that James Morris has submitted some time ago, but AFAICS these were never accepted/merged.

Asking him (off-list) he mentioned that any such work would need to take place in NFS4.

I've seen some comments from the past, saying that it should never happen since it would cause performance issues - but I guess one could make it optional.

I have some use case where I need a network filesystem with XATTR support providing the features of most standard filesystems (locking, etc.).
And I'm sure there are plenty more use-cases.

So are there any plans to get this into NFS?

Cheers,
Chris.

btw: please keep me CCed.

#1 lore raw
Quoted 19 lines · Christoph Anton Mitterer

Hi.

I just wondered about the current situation (respectively plans) regarding XATTRs in NFS (I personally don't care much about the version,... of course v4 would be nice, but v3 should do either).

I'm aware about the patches for v3 that James Morris has submitted some time ago, but AFAICS these were never accepted/merged.

Asking him (off-list) he mentioned that any such work would need to take place in NFS4.

I've seen some comments from the past, saying that it should never happen since it would cause performance issues - but I guess one could make it optional.

Quoted 8 lines

I have some use case where I need a network filesystem with XATTR support providing the features of most standard filesystems (locking, etc.).
And I'm sure there are plenty more use-cases.

So are there any plans to get this into NFS?

labeled NFS (i.e. security labels for NFS) is already supported in Linux 3.10 and newer.

There are no plans to merge general purpose xattrs. Please just use an application-specific database.

Cheers
Trond

#2 lore raw
Quoted 1 line · Trond

labeled NFS (i.e. security labels for NFS) is already supported in Linux 3.10 and newer.

Sure, but that doesn't really help me.

Quoted 1 line

There are no plans to merge general purpose xattrs.

Why not? Is it a big deal?

Quoted 1 line

Please just use an application-specific database.

Well that won't work,... since that wouldn't be updated if e.g. pathnames are changed by any program (cp, mv)

Cheers,
Chris.

#3 lore raw
Quoted 8 lines · Christoph Anton Mitterer
Quoted 1 line · Trond

labeled NFS (i.e. security labels for NFS) is already supported in Linux 3.10 and newer.

Sure, but that doesn't really help me.

Quoted 1 line

There are no plans to merge general purpose xattrs.

Why not? Is it a big deal?

Linux xattrs are a rabid mess.

The whole "system" namespace is something that cannot and should not ever be exposed on a network. The "trusted" and "user" namespaces just offer specialised storage. Why are they needed?

Quoted 4 lines
Quoted 2 lines

Please just use an application-specific database.

Well that won't work,... since that wouldn't be updated if e.g. pathnames are changed by any program (cp, mv)

If the data needs to follow the file, then store it in the file. Why do you need the filesystem to manage that for you?

Cheers
Trond

#4 lore raw
Quoted 4 lines · Trond
Quoted 2 lines · Christoph Anton Mitterer
Quoted 1 line · Trond

labeled NFS (i.e. security labels for NFS) is already supported in Linux 3.10 and newer.

Quoted 8 lines
Quoted 6 lines

Sure, but that doesn't really help me.

Quoted 1 line

There are no plans to merge general purpose xattrs.

Why not? Is it a big deal?

Linux xattrs are a rabid mess.

First time I hear this :)

Quoted 2 lines

The whole "system" namespace is something that cannot and should not ever be exposed on a network. The "trusted" and "user" namespaces just offer specialised storage. Why are they needed?

Samba for example stores various metadata bits of information there (DOS bits, original ACLs before posix translation, etc..). Loosing that data on an mv via NFS breaks stuff.
That said samba and NFS have other synchronization issues, so it is not the best example, but you can't just discount xattrs. They exist, they are used, and if you don't have support for them in NFS you are not transparent to applications.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Please just use an application-specific database.

Well that won't work,... since that wouldn't be updated if e.g. pathnames are changed by any program (cp, mv)

If the data needs to follow the file, then store it in the file. Why do you need the filesystem to manage that for you?

Because the filesystem can do that when multiple applications are involved without having to change them all to talk to each other and invent custom protocol all the time just to keep some additional metadata associated to a file..

Simo.

Signature · 1 line
Simo Sorce * Red Hat, Inc * New York
#5 lore raw
Quoted 5 lines · Simo Sorce

Because the filesystem can do that when multiple applications are involved without having to change them all to talk to each other and invent custom protocol all the time just to keep some additional metadata associated to a file..

It's still a custom protocol. The applications need to agree on a data format and store it somewhere. The portable way to do this is to write an application library that they can link to.

Signature · 6 lines
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
www.netapp.com
#6 lore raw
Quoted 10 lines · Trond
Quoted 5 lines · Simo Sorce

Because the filesystem can do that when multiple applications are involved without having to change them all to talk to each other and invent custom protocol all the time just to keep some additional metadata associated to a file..

It's still a custom protocol. The applications need to agree on a data format and store it somewhere. The portable way to do this is to write an application library that they can link to.

Perhaps I was unclear, you are never going to see that custom library linked into the 'mv' command.

So your approach makes little sense if the object is to maintain data coherent when people need to handle files from random applications and scripts and general system maintenance.

The data may be relevant only to a specific application.

I am not saying you *have* to implement xattrs support, just saying that it is not a mere 'applications should synchronize data themselves' problem.

Simo.

Signature · 1 line
Simo Sorce * Red Hat, Inc * New York
#7 lore raw
Quoted 19 lines · On Thu, 24 Oct 2013 11:16:10 -0400 Simo Sorce <[email protected]> wrote:
Quoted 10 lines · Trond
Quoted 5 lines · Simo Sorce

Because the filesystem can do that when multiple applications are involved without having to change them all to talk to each other and invent custom protocol all the time just to keep some additional metadata associated to a file..

It's still a custom protocol. The applications need to agree on a data format and store it somewhere. The portable way to do this is to write an application library that they can link to.

Perhaps I was unclear, you are never going to see that custom library linked into the 'mv' command.

So your approach makes little sense if the object is to maintain data coherent when people need to handle files from random applications and scripts and general system maintenance.

Quoted 6 lines

The data may be relevant only to a specific application.

I am not saying you *have* to implement xattrs support, just saying that it is not a mere 'applications should synchronize data themselves' problem.

I think the real solution if people need this is to lead an effort to put xattrs into the spec. I think there is still time to get new features into v4.3 if someone wants to champion it...

Signature · 1 line
Jeff Layton <[email protected]>
#8 lore raw

Hi,

It appears that there could be spec implications, but I have not so far been convinced that nfsv4.x named attributes are not an appropriate vehicle for (some set of) extended attributes.

The fact that nfsv4.x named attributes are suitable to represent large objects, does not make them unsuitable to represent key value properties.

Matt

Quoted 49 lines · ----- "Jeff Layton
Quoted 4 lines · On Thu, 24 Oct 2013 11:16:10 -0400 Simo Sorce <[email protected]> wrote:
Quoted 3 lines · Trond
Quoted 1 line · Simo Sorce

Because the filesystem can do that when multiple applications

are

Quoted 1 line
Quoted 1 line
Quoted 1 line

involved without having to change them all to talk to each other

and

Quoted 1 line
Quoted 1 line
Quoted 1 line

invent custom protocol all the time just to keep some

additional

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

metadata associated to a file..

It's still a custom protocol. The applications need to agree on a

data

Quoted 1 line
Quoted 1 line

format and store it somewhere. The portable way to do this is to

write

Quoted 3 lines
Quoted 1 line

an application library that they can link to.

Perhaps I was unclear, you are never going to see that custom

library

Quoted 3 lines

linked into the 'mv' command.

So your approach makes little sense if the object is to maintain

data

Quoted 1 line

coherent when people need to handle files from random applications

and

Quoted 5 lines

scripts and general system maintenance.

The data may be relevant only to a specific application.

I am not saying you *have* to implement xattrs support, just saying

that

Quoted 3 lines

it is not a mere 'applications should synchronize data themselves' problem.

I think the real solution if people need this is to lead an effort to put xattrs into the spec. I think there is still time to get new features into v4.3 if someone wants to champion it...

Signature · 6 lines
Jeff Layton <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs"
in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 10 lines
Matt Benjamin
The Linux Box
206 South Fifth Ave. Suite 150
Ann Arbor, MI  48104

http://linuxbox.com

tel.  734-761-4689 
fax.  734-769-8938 
cel.  734-216-5309 
#9 lore raw
In reply to Jeff Layton
Quoted 24 lines · Jeff Layton
Quoted 21 lines · On Thu, 24 Oct 2013 11:16:10 -0400 Simo Sorce <[email protected]> wrote:
Quoted 10 lines · Trond
Quoted 5 lines · Simo Sorce

Because the filesystem can do that when multiple applications are involved without having to change them all to talk to each other and invent custom protocol all the time just to keep some additional metadata associated to a file..

It's still a custom protocol. The applications need to agree on a data format and store it somewhere. The portable way to do this is to write an application library that they can link to.

Perhaps I was unclear, you are never going to see that custom library linked into the 'mv' command.

So your approach makes little sense if the object is to maintain data coherent when people need to handle files from random applications and scripts and general system maintenance.

The data may be relevant only to a specific application.

Quoted 9 lines
Quoted 4 lines

I am not saying you *have* to implement xattrs support, just saying that it is not a mere 'applications should synchronize data themselves' problem.

I think the real solution if people need this is to lead an effort to put xattrs into the spec. I think there is still time to get new features into v4.3 if someone wants to champion it...

How would that help? Witness Oracle's success with named attributes, which are _also_ a non-standard filesystem feature that was hastily pushed into the NFSv4 spec.

If you really need this for use by applications (as opposed to by sysadmins - see labeled NFS), then get the functionality into POSIX first, then add it to the NFS spec.

Signature · 6 lines
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
www.netapp.com
#10 lore raw
In reply to Jeff Layton
Quoted 1 line · Jeff Layton

I think the real solution if people need this is to lead an effort to

I'm often reading this argument,... "if people need this", respectively the argument "XATTRs/ACLs" aren't widely used so we're not going to support them.

IMHO that's no really an argument.... the simple reason that this isn't widely used, is likely that there are still many places that don't support it.

All the major Linux (disk) filesystems support it, right? ext*/btrfs/XFS But many (even standard clients) do either not (e.g. normal GNU tar format) or behave in a way that somehow break or lose XATTRs/ACLs (e.g. vim),... NFS is another example - a very important IMHO since it is THE network filesystem.

So sure,... not many people are using XATTRs, ACLs, but the reason is simply, that there are still many obstacles in the way - in many cases upstream refusing to solve these, for the reason that allegedly noone uses XATTRs/ACLs.
(Which is btw. not fully true,... many modernish stuff like uses e.g. ACLs like in /dev/).

I do agree that especially the ACLs from POSIX are not the best thing (NFS4 ACLs are much better),... but I don't see the big problem with key/value pairs from XATTRs.

Cheers,
Chris.

#11 lore raw
In reply to Simo Sorce
Quoted 8 lines · Simo Sorce
Quoted 7 lines · Trond
Quoted 5 lines · Simo Sorce

Because the filesystem can do that when multiple applications are involved without having to change them all to talk to each other and invent custom protocol all the time just to keep some additional metadata associated to a file..

Quoted 7 lines
Quoted 3 lines

It's still a custom protocol. The applications need to agree on a data format and store it somewhere. The portable way to do this is to write an application library that they can link to.

Perhaps I was unclear, you are never going to see that custom library linked into the 'mv' command.

Why should my mv need to link into such a library?

Quoted 4 lines

So your approach makes little sense if the object is to maintain data coherent when people need to handle files from random applications and scripts and general system maintenance.

See the earlier admonition: store data that needs to be kept together either in the same file, or in the same directory. Use a library when different applications need to access the same data.

Quoted 5 lines

The data may be relevant only to a specific application.

I am not saying you *have* to implement xattrs support, just saying that it is not a mere 'applications should synchronize data themselves' problem.

_portable_ applications do not use xattrs. They are a Linuxism that is not described by either POSIX or any other similar standard.

Trond

#12 lore raw
In reply to Myklebust, Trond
Quoted 1 line · Trond

Linux xattrs are a rabid mess.

Well... might be from a technical POV, but for users they're quite useful in some scenarios.

Quoted 2 lines

The whole "system" namespace is something that cannot and should not ever be exposed on a network. The "trusted" and "user" namespaces just offer specialised storage. Why are they needed?

Well what I do is attaching integrity information to files.

You may say now that this is similar to what btrfs will provide anyway... but the problem with that is, that checksums are always updated when something in the system does valid changes to the file.

What I however want is that I really manually have to set this, so that I notice "accidental" changes, e.g. by myself or by buggy software...

Quoted 1 line

If the data needs to follow the file, then store it in the file. Why do you need the filesystem to manage that for you?

... and since this applies to arbitrary files, from text-files over pictures, videos to binaries,... it's neither possible to store this in the file, nor can I really track this with an database,... since literally any program that uses such files, from the picture editor to the file-manager would need to use such DB.

Cheers,
Chris.

#13 lore raw
Quoted 18 lines · Christoph Anton Mitterer
Quoted 1 line · Trond

Linux xattrs are a rabid mess.

Well... might be from a technical POV, but for users they're quite useful in some scenarios.

Quoted 2 lines

The whole "system" namespace is something that cannot and should not ever be exposed on a network. The "trusted" and "user" namespaces just offer specialised storage. Why are they needed?

Well what I do is attaching integrity information to files.

You may say now that this is similar to what btrfs will provide anyway... but the problem with that is, that checksums are always updated when something in the system does valid changes to the file.

What I however want is that I really manually have to set this, so that I notice "accidental" changes, e.g. by myself or by buggy software...

Quoted 6 lines
Quoted 1 line

If the data needs to follow the file, then store it in the file. Why do you need the filesystem to manage that for you?

... and since this applies to arbitrary files, from text-files over pictures, videos to binaries,... it's neither possible to store this in the file, nor can I really track this with an database,... since literally any program that uses such files, from the picture editor to the file-manager would need to use such DB.

Those programs need to recompute the checksum data anyway in order to verify and/or update it. Checksums that are computed by some third party application have exactly zero value for integrity checking.

Trond

#14 lore raw
Quoted 3 lines · Trond

Those programs need to recompute the checksum data anyway in order to verify and/or update it. Checksums that are computed by some third party application have exactly zero value for integrity checking.

No that's exactly the point,... the applications should _NOT_ set those checksums, especially not automagically (since then you'd never notice when just some application is buggy or writes/modifies when you don't expect it to do so).
The idea is that there is on application (in my case it's just a script), which sets the integrity data and verifies it.

This works very well for e.g. large data archives, where you most of the time (but not always) only read files, write new files or move around existing ones - but only rarely modify existing file's contents.

I do this already like that on local filesystems, which works very nicely with XATTRs... but now I want to move this on a central data cluster (where clients connect to via NFS)... and here the problems start... when I add new data to the archive (from the clients) I cannot have XATTRs attached, nor can I verify them form the clients.

Cheers,
Chris.

#15 lore raw
Quoted 16 lines · Christoph Anton Mitterer
Quoted 3 lines · Trond

Those programs need to recompute the checksum data anyway in order to verify and/or update it. Checksums that are computed by some third party application have exactly zero value for integrity checking.

No that's exactly the point,... the applications should _NOT_ set those checksums, especially not automagically (since then you'd never notice when just some application is buggy or writes/modifies when you don't expect it to do so).
The idea is that there is on application (in my case it's just a script), which sets the integrity data and verifies it.

This works very well for e.g. large data archives, where you most of the time (but not always) only read files, write new files or move around existing ones - but only rarely modify existing file's contents.

Quoted 5 lines

I do this already like that on local filesystems, which works very nicely with XATTRs... but now I want to move this on a central data cluster (where clients connect to via NFS)... and here the problems start... when I add new data to the archive (from the clients) I cannot have XATTRs attached, nor can I verify them form the clients.

Can you give any more details about your use case? (E.g. is there an article describing this system somewhere?)

Just curious.--b.

#16 lore raw
Quoted 22 lines · J. Bruce Fields
Quoted 16 lines · Christoph Anton Mitterer
Quoted 3 lines · Trond

Those programs need to recompute the checksum data anyway in order to verify and/or update it. Checksums that are computed by some third party application have exactly zero value for integrity checking.

No that's exactly the point,... the applications should _NOT_ set those checksums, especially not automagically (since then you'd never notice when just some application is buggy or writes/modifies when you don't expect it to do so).
The idea is that there is on application (in my case it's just a script), which sets the integrity data and verifies it.

This works very well for e.g. large data archives, where you most of the time (but not always) only read files, write new files or move around existing ones - but only rarely modify existing file's contents.

Quoted 5 lines

I do this already like that on local filesystems, which works very nicely with XATTRs... but now I want to move this on a central data cluster (where clients connect to via NFS)... and here the problems start... when I add new data to the archive (from the clients) I cannot have XATTRs attached, nor can I verify them form the clients.

Quoted 5 lines

Can you give any more details about your use case? (E.g. is there an article describing this system somewhere?)

Just curious.--b.

I think that having xattrs in NFS would be very useful over time. A lot of user space tools have been made aware of them, we are certainly lagging all (almost all?) local file system here and it can cause a data loss when you copy a file from a local file system to an NFS server.

It certainly violates the principle of least surprise that the xattrs are lost when move through NFS!

Typical use cases I have seen include storing things like metadata that tracks what application created the file, tags to let you know when the last time the file was verified by a data integrity scrubber, tags that hold a checksum/crypto has of the file contents along with the date of that signature.

Doing a file system service does not mean that we have to be personally interested in all of the odd things that our users might use features for, but at this point, xattrs are water under the bridge and NFS not supporting them makes us look bad :)

Ric

#17 lore raw
Quoted 29 lines · Ric Wheeler
Quoted 22 lines · J. Bruce Fields
Quoted 16 lines · Christoph Anton Mitterer
Quoted 3 lines · Trond

Those programs need to recompute the checksum data anyway in order to verify and/or update it. Checksums that are computed by some third party application have exactly zero value for integrity checking.

No that's exactly the point,... the applications should _NOT_ set those checksums, especially not automagically (since then you'd never notice when just some application is buggy or writes/modifies when you don't expect it to do so).
The idea is that there is on application (in my case it's just a script), which sets the integrity data and verifies it.

This works very well for e.g. large data archives, where you most of the time (but not always) only read files, write new files or move around existing ones - but only rarely modify existing file's contents.

Quoted 5 lines

I do this already like that on local filesystems, which works very nicely with XATTRs... but now I want to move this on a central data cluster (where clients connect to via NFS)... and here the problems start... when I add new data to the archive (from the clients) I cannot have XATTRs attached, nor can I verify them form the clients.

Quoted 5 lines

Can you give any more details about your use case? (E.g. is there an article describing this system somewhere?)

Just curious.--b.

Quoted 7 lines

I think that having xattrs in NFS would be very useful over time. A lot of user space tools have been made aware of them, we are certainly lagging all (almost all?) local file system here and it can cause a data loss when you copy a file from a local file system to an NFS server.

It certainly violates the principle of least surprise that the xattrs are lost when move through NFS!

Typical use cases I have seen include storing things like metadata that tracks what application created the file, tags to let you know when the last time the file was verified by a data integrity scrubber, tags that hold a checksum/crypto has of the file contents along with the date of that signature.

Doing a file system service does not mean that we have to be personally interested in all of the odd things that our users might use features for, but at this point, xattrs are water under the bridge and NFS not supporting them makes us look bad :)

Trond's point is that it still would be a very heavy lift for us.

Local file systems can support whatever they like, since they are Linux-only.

NFS has to interoperate with other operating systems that may or may not support xattrs, or may have something that looks like an xattr, but really is subtly incompatible.

Therefore we must have a standard for storing and accessing xattrs locally (POSIX) and a standard for expressing their name and content on the wire (IETF NFS) before we can consider an implementation.

So we would like to see some very clear evidence that it's worth the effort. Until then, Linux distributors are free to implement NFS xattr support outside the standard NFS protocol (like the Solaris NFSv3 ACL protocol) and support this themselves, perhaps as proof that "if you build it, they will come."

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#18 lore raw
Quoted 5 lines · Chuck Lever

Local file systems can support whatever they like, since they are Linux-only.
NFS has to interoperate with other operating systems that may or may not support xattrs, or may have something that looks like an xattr, but really is subtly incompatible.

Well but that alone can apply to most other things that NFS does support as well.
Take NFS4 ACLs,... not (fully) supported by I'd guess every Linux filesystem (or was there some proposal for btrfs to get NFS4 ACLs in addition?)
Or take very old filesystem who have no concept of different owners. etc. pp.

In any case (as with Linux filesystems as well), I think XATTRs shouldn't be enabled by default, if NFS was to support them... and if someone activates it, he probably knows whether the backend fs does support it or not.

Quoted 5 lines

So we would like to see some very clear evidence that it's worth the effort. Until then, Linux distributors are free to implement NFS xattr support outside the standard NFS protocol (like the Solaris NFSv3 ACL protocol) and support this themselves, perhaps as proof that "if you build it, they will come."

This always bears the danger that it will become a de facto standard that one cannot get rid of anymore.

Cheers,
Chris.

#19 lore raw
In reply to Ric Wheeler
Quoted 26 lines · Ric Wheeler
Quoted 25 lines · J. Bruce Fields
Quoted 16 lines · Christoph Anton Mitterer
Quoted 3 lines · Trond

Those programs need to recompute the checksum data anyway in order to verify and/or update it. Checksums that are computed by some third party application have exactly zero value for integrity checking.

No that's exactly the point,... the applications should _NOT_ set those checksums, especially not automagically (since then you'd never notice when just some application is buggy or writes/modifies when you don't expect it to do so).
The idea is that there is on application (in my case it's just a script), which sets the integrity data and verifies it.

This works very well for e.g. large data archives, where you most of the time (but not always) only read files, write new files or move around existing ones - but only rarely modify existing file's contents.

Quoted 5 lines

I do this already like that on local filesystems, which works very nicely with XATTRs... but now I want to move this on a central data cluster (where clients connect to via NFS)... and here the problems start... when I add new data to the archive (from the clients) I cannot have XATTRs attached, nor can I verify them form the clients.

Can you give any more details about your use case? (E.g. is there an article describing this system somewhere?)

Quoted 6 lines
Quoted 2 lines

Just curious.--b.

I think that having xattrs in NFS would be very useful over time. A lot of user space tools have been made aware of them, we are certainly lagging all (almost all?) local file system here and it can cause a data loss when you copy a file from a local file system to an NFS server.

It certainly violates the principle of least surprise that the xattrs are lost when move through NFS!

The _problem_ is that xattrs are a system call interface. Setting the xattrs in the "system", "security", or even the "trusted" namespace have undocumented side effects. There are very good security reasons why NFS doesn't have an IOCTL rpc call for executing arbitrary ioctls on the NFS server. Those same reasons apply to xattr.

Quoted 1 line

Typical use cases I have seen include storing things like metadata that tracks what application created the file, tags to let you know when the last time the file was verified by a data integrity scrubber, tags that hold a checksum/crypto has of the file contents along with the date of that signature.

Standardise those xattrs, and we can export them specifically as part of the NFSv4 spec.

Quoted 1 line

Doing a file system service does not mean that we have to be personally interested in all of the odd things that our users might use features for, but at this point, xattrs are water under the bridge and NFS not supporting them makes us look bad :)

I'd rather look bad for not supporting a broken filesystem feature than have to deal with the abiove mentioned side-effects. Until the xattr interface is properly documented and standardised so that it can be exported safely, it should be treated as a unexportable, in the same way we treat procfs and sysfs.

Cheers
Trond

A message that is not in the archive (sent off-list or not yet received): OF01D9818B.36018C0F-ON88257C10.00608BC0-88257C10.006139C6@LocalDomain

#21 lore raw

[email protected] wrote on 10/26/2013 06:20:12 AM:

Quoted 6 lines

I'd rather look bad for not supporting a broken filesystem feature than have to deal with the abiove mentioned side-effects. Until the xattr interface is properly documented and standardised so that it can be exported safely, it should be treated as a unexportable, in the same way we treat procfs and sysfs.

This sounds more like an NFS server problem than a client side NFS. Can we add support to the client side NFS and let server that think that they can handle XATTR implement it?

We should probably start a discussion in the IETF to resolve the issues you see with XATTR at least for NFSv4.3.

Marc.

Quoted 2 lines

Cheers
Trond--

#22 lore raw
Quoted 9 lines · Marc Eshel

[email protected] wrote on 10/26/2013 06:20:12 AM:

Quoted 6 lines

I'd rather look bad for not supporting a broken filesystem feature than have to deal with the abiove mentioned side-effects. Until the xattr interface is properly documented and standardised so that it can be exported safely, it should be treated as a unexportable, in the same way we treat procfs and sysfs.

Quoted 3 lines

This sounds more like an NFS server problem than a client side NFS. Can we add support to the client side NFS and let server that think that they can handle XATTR implement it?

No. It's a real problem for clients too if the NFS server starts exporting ACLs and security labels via this interface. Everything from integer endianness problems when getfacl attempts to read raw binary acls from the server, to breakage of caching models when we allow setfacl and don't invalidate our file access caches...

Quoted 2 lines

We should probably start a discussion in the IETF to resolve the issues you see with XATTR at least for NFSv4.3.

Let's get the basic discussion of motivation right first.

Trond

#23 lore raw
Quoted 1 line · Trond

Let's get the basic discussion of motivation right first.

Actually I might know another use case.

dCache[0] which implements a (p)NFS 4.1 server and is heavily used within the high energy physics community, could benefit from XATTRs as well.

Ever since, dCache has had a concept called PNFS tags (where the PNFS had nothing to do with parallel NFS, but is called so for other historical reasons), which are basically key/value pairs belonging to some file (well at least directory, I don't remember where PNFS tags exist for regular files).

These tags are used to control several things, indirectly, e.g. to which data pool node a file may go, and via that whether it may be moved to tape, whether it is duplicated, etc. pp.

Since there were no XATTRs (at least I guess that's the historical reason), they used special files for this having the name:
".(tag)(key)" and the content of the file is the value.

So for a path,
/data/foo/bar/
one can set the key "sGroup" (aka storage group) to a value say "ATLAS" (which (very simplified) will tell dCache in the end that this is storage belonging to the ATLAS experiment) by creating a file echo "ATLAS" > '/data/foo/bar/.(tag)(sGroup)'

Obviously having such special files isn't that nice, and having real XATTRs would be the better solution.

Cheers,
Chris.

btw: Note that while I'm good friends with the dCache developers, I don't speak for them, nor do I know whether they'd really like this or not.

[0] http://www.dcache.org/

#24 lore raw
Quoted 30 lines · Christoph Anton Mitterer
Quoted 1 line · Trond

Let's get the basic discussion of motivation right first.

Actually I might know another use case.

dCache[0] which implements a (p)NFS 4.1 server and is heavily used within the high energy physics community, could benefit from XATTRs as well.

Ever since, dCache has had a concept called PNFS tags (where the PNFS had nothing to do with parallel NFS, but is called so for other historical reasons), which are basically key/value pairs belonging to some file (well at least directory, I don't remember where PNFS tags exist for regular files).

These tags are used to control several things, indirectly, e.g. to which data pool node a file may go, and via that whether it may be moved to tape, whether it is duplicated, etc. pp.

Since there were no XATTRs (at least I guess that's the historical reason), they used special files for this having the name:
".(tag)(key)" and the content of the file is the value.

So for a path,
/data/foo/bar/
one can set the key "sGroup" (aka storage group) to a value say "ATLAS" (which (very simplified) will tell dCache in the end that this is storage belonging to the ATLAS experiment) by creating a file echo "ATLAS" > '/data/foo/bar/.(tag)(sGroup)'

Quoted 2 lines

Obviously having such special files isn't that nice, and having real XATTRs would be the better solution.

Ordinary groups can do the same.

Trond

#25 lore raw
Quoted 1 line · Trond

Ordinary groups can do the same.

For sure not,.. a) groups are already used for something else (namely the normal semantics of groups, and the sGroup does not necessarily need to correspond to the UNIX owning group (actually it usually does not).

b) sGroup is only one of several tags,... there are tags which control space tokens, there are tags which contain dCache's own file checksums, etc. pp.

Cheers,
Chris.

#26 lore raw
In reply to Myklebust, Trond
Quoted 9 lines · Trond
Quoted 3 lines

This sounds more like an NFS server problem than a client side NFS. Can we add support to the client side NFS and let server that think that they can handle XATTR implement it?

No. It's a real problem for clients too if the NFS server starts exporting ACLs and security labels via this interface. Everything from integer endianness problems when getfacl attempts to read raw binary acls from the server, to breakage of caching models when we allow setfacl and don't invalidate our file access caches...

Right, so any general xattrs for nfs would need to be specified as having no system effects, essentially exporting the Linux 'user' xattr namespace only.

Quoted 5 lines
Quoted 3 lines

We should probably start a discussion in the IETF to resolve the issues you see with XATTR at least for NFSv4.3.

Let's get the basic discussion of motivation right first.

It should be for user-managed metadata only.

Signature · 2 lines
James Morris
<[email protected]>
#27 lore raw
Quoted 15 lines · James Morris
Quoted 8 lines · Trond
Quoted 3 lines

This sounds more like an NFS server problem than a client side NFS. Can we add support to the client side NFS and let server that think that they can handle XATTR implement it?

No. It's a real problem for clients too if the NFS server starts exporting ACLs and security labels via this interface. Everything from integer endianness problems when getfacl attempts to read raw binary acls from the server, to breakage of caching models when we allow setfacl and don't invalidate our file access caches...

Right, so any general xattrs for nfs would need to be specified as having no system effects, essentially exporting the Linux 'user' xattr namespace only.

Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

We should probably start a discussion in the IETF to resolve the issues you see with XATTR at least for NFSv4.3.

Let's get the basic discussion of motivation right first.

It should be for user-managed metadata only.

That would be what I would like to see over NFS...

ric

#28 lore raw
In reply to J. Bruce Fields
Quoted 2 lines · J. Bruce Fields

Can you give any more details about your use case? (E.g. is there an article describing this system somewhere?)

Okay let me try to explain the motivation more elaborately.

The general idea is getting data integrity, i.e. being able to see whether some files are in a valid state.

This is similar to what e.g. btrfs/zfs provide at (IIRC block/extent level) with checksuming.
But a) btrfs is not yet fully production ready (IMHO) and zfs in Linux has it's (license) issues and more important b) the checksuming there happens always and automatically as soon as some valid filesystem operations occur on the files.

So what you basically notice are errors on the physical medium (or at least on block layers below the filesystem).

You won't notice many other cases of file "corruptions":

- when you have programs which do subtly manipulate the files and you don't notice,...e.g. some image organisation programs store their meta-data crap in the Exif/XMP fields, even when you don't actively tell them to do so (and sometimes even when the files are read-only)

- when there are e.g. kernel bugs (in some other places of the kernel) and you copy the files around. Some years ago I found a bug (not the solution) where single bit errors happened more or less randomly every 40-100 GB of writing data. In the end it was found to be a IOMMU related bug and a single one liner of flushing some buffers cleared the problem. Since such errors would happen already at earlier stages, when writing such files btrfs/zfs would simply write the checksums of the corrupted data.

So the idea of my integrity data is, that I really manually say "now the data is in the state where I consider it to be consistent and I want to have checksums stored and attached to the files, for exactly that state", e.g. after I have read out some images from the SD card (perhaps even twice with the cache cleared and the results diffed) and placed in my archive.
Afterwards I can regularly verify the whole archive and if at some stage corruptions as the above would have happened, I can simply take the respective files from backups.

Obviously that cannot be stored *in* the files,... and a database solution fails since, it wouldn't track the changes when I move files around within the archive.

So IMHO the best solution were XATTRs, which do work fine for that purpose... just the problem that I can't have it via NFS ;)

Cheers,
Chris.

#29 lore raw

Please don't trim the cc list.

Quoted 26 lines · Christoph Anton Mitterer
Quoted 2 lines · J. Bruce Fields

Can you give any more details about your use case? (E.g. is there an article describing this system somewhere?)

Okay let me try to explain the motivation more elaborately.

The general idea is getting data integrity, i.e. being able to see whether some files are in a valid state.

This is similar to what e.g. btrfs/zfs provide at (IIRC block/extent level) with checksuming.
But a) btrfs is not yet fully production ready (IMHO) and zfs in Linux has it's (license) issues and more important b) the checksuming there happens always and automatically as soon as some valid filesystem operations occur on the files.

So what you basically notice are errors on the physical medium (or at least on block layers below the filesystem).

You won't notice many other cases of file "corruptions":

- when you have programs which do subtly manipulate the files and you don't notice,...e.g. some image organisation programs store their meta-data crap in the Exif/XMP fields, even when you don't actively tell them to do so (and sometimes even when the files are read-only)

Quoted 8 lines

- when there are e.g. kernel bugs (in some other places of the kernel) and you copy the files around. Some years ago I found a bug (not the solution) where single bit errors happened more or less randomly every 40-100 GB of writing data. In the end it was found to be a IOMMU related bug and a single one liner of flushing some buffers cleared the problem. Since such errors would happen already at earlier stages, when writing such files btrfs/zfs would simply write the checksums of the corrupted data.

Was this problem actually caught using checksums stored in xattrs, or did the problem predate your use of xattrs?

Quoted 9 lines

So the idea of my integrity data is, that I really manually say "now the data is in the state where I consider it to be consistent and I want to have checksums stored and attached to the files, for exactly that state", e.g. after I have read out some images from the SD card (perhaps even twice with the cache cleared and the results diffed) and placed in my archive.
Afterwards I can regularly verify the whole archive and if at some stage corruptions as the above would have happened, I can simply take the respective files from backups.

How long have you been using this for? How many problems has it caught? How often do you checksum or verify files, and how expensive is that?

--b.

Quoted 13 lines

Obviously that cannot be stored *in* the files,... and a database solution fails since, it wouldn't track the changes when I move files around within the archive.

So IMHO the best solution were XATTRs, which do work fine for that purpose... just the problem that I can't have it via NFS ;)

Cheers,
Chris.

#30 lore raw
Quoted 2 lines · J. Bruce Fields

Was this problem actually caught using checksums stored in xattrs, or did the problem predate your use of xattrs?

Phew... don't remember actually... but I think I haven't used that already back then and noticed it by chance when I did some diffs.

Quoted 10 lines
Quoted 9 lines

So the idea of my integrity data is, that I really manually say "now the data is in the state where I consider it to be consistent and I want to have checksums stored and attached to the files, for exactly that state", e.g. after I have read out some images from the SD card (perhaps even twice with the cache cleared and the results diffed) and placed in my archive.
Afterwards I can regularly verify the whole archive and if at some stage corruptions as the above would have happened, I can simply take the respective files from backups.

How long have you been using this for?

Uhm... about 3-4 years now.

Quoted 1 line

How many problems has it caught?

I do not keep exact statistics... but I remember a few cases where I found damaged backups (optimal media) which I replaced as a consequence.

Quoted 1 line

How often do you checksum or verify files, and how expensive is that?

Not that often,... on my actual data disks,... about every 4 months... on my backup media (I use to keep older generations of backups as well) about once a year.

I've never really looked at how expensive it is,... all you need to do is simply reading all data + have their hashes calculated.

Cheers,
Chris.

#31 lore raw
Quoted 23 lines · Christoph Anton Mitterer
Quoted 2 lines · J. Bruce Fields

Was this problem actually caught using checksums stored in xattrs, or did the problem predate your use of xattrs?

Phew... don't remember actually... but I think I haven't used that already back then and noticed it by chance when I did some diffs.

Quoted 10 lines
Quoted 9 lines

So the idea of my integrity data is, that I really manually say "now the data is in the state where I consider it to be consistent and I want to have checksums stored and attached to the files, for exactly that state", e.g. after I have read out some images from the SD card (perhaps even twice with the cache cleared and the results diffed) and placed in my archive.
Afterwards I can regularly verify the whole archive and if at some stage corruptions as the above would have happened, I can simply take the respective files from backups.

How long have you been using this for?

Uhm... about 3-4 years now.

Quoted 1 line

How many problems has it caught?

I do not keep exact statistics... but I remember a few cases where I found damaged backups (optimal media) which I replaced as a consequence.

Quoted 7 lines
Quoted 1 line

How often do you checksum or verify files, and how expensive is that?

Not that often,... on my actual data disks,... about every 4 months... on my backup media (I use to keep older generations of backups as well) about once a year.

I've never really looked at how expensive it is,... all you need to do is simply reading all data + have their hashes calculated.

...and if the checksums are any good, then all you need to do to substitute a database is to realise that a good data checksum is invariant under renames.

#32 lore raw
Quoted 3 lines · Trond

...and if the checksums are any good, then all you need to do to substitute a database is to realise that a good data checksum is invariant under renames.

Don't quite see what you mean...

Sure the checksums stay the same, but consider you have many millions of files, and you moved them around and thus the paths in the DB are incorrect... verifying the files will become very much a pain in the a**, especially when multiple files don't verify anymore.

Or what if you have many small similar files, where errors could lead to a checksum that was a correct one for another file,... when the paths are no longer valid you cannot know if this was a correct file or not.

Cheers,
Chris.

#33 lore raw
Quoted 7 lines · Christoph Anton Mitterer
Quoted 3 lines · Trond

...and if the checksums are any good, then all you need to do to substitute a database is to realise that a good data checksum is invariant under renames.

Don't quite see what you mean...

Quoted 8 lines

Sure the checksums stay the same, but consider you have many millions of files, and you moved them around and thus the paths in the DB are incorrect... verifying the files will become very much a pain in the a**, especially when multiple files don't verify anymore.

Or what if you have many small similar files, where errors could lead to a checksum that was a correct one for another file,... when the paths are no longer valid you cannot know if this was a correct file or not.

If you have lots of small files, and you really do need to associate them uniquely with the checksum, then try something like:

ln <filename> /path/to/database/<SHA512 identifier>.<inode number>

Hard links and inode numbers are also generally invariant under 'mv'.

Trond

#34 lore raw
Quoted 5 lines · Trond

If you have lots of small files, and you really do need to associate them uniquely with the checksum, then try something like:

ln <filename> /path/to/database/<SHA512 identifier>.<inode number>

Hard links and inode numbers are also generally invariant under 'mv'.

Well that seems like a workaround, IMHO not like a real solution,... since when you remove <filename> the file will stay due to /path/to/database/<SHA512 identifier>.<inode number> .

Of course you can run regular scrubbing jobs, which remove and /path/to/database/<SHA512 identifier>.<inode number> for which the link count is one.

Anyway as said, IMHO it's a (nice) workaround which I haven't thought of, admittedly, but not a clean solution... and AFAICS it fixes only my personal use case.

Cheers,
Chris.

#35 lore raw
In reply to Myklebust, Trond
Quoted 16 lines · Trond
Quoted 6 lines · Christoph Anton Mitterer
Quoted 3 lines · Trond

...and if the checksums are any good, then all you need to do to substitute a database is to realise that a good data checksum is invariant under renames.

Don't quite see what you mean...

Quoted 8 lines

Sure the checksums stay the same, but consider you have many millions of files, and you moved them around and thus the paths in the DB are incorrect... verifying the files will become very much a pain in the a**, especially when multiple files don't verify anymore.

Or what if you have many small similar files, where errors could lead to a checksum that was a correct one for another file,... when the paths are no longer valid you cannot know if this was a correct file or not.

Quoted 8 lines

If you have lots of small files, and you really do need to associate them uniquely with the checksum, then try something like:

ln <filename> /path/to/database/<SHA512 identifier>.<inode number>

Hard links and inode numbers are also generally invariant under 'mv'.

Trond--

Then you end up with large directories and an extra name per inode that needs to be stored and extra lookups for each file when you do a whole file system crawl.

Certainly not as easy as adding and xattrs with that information :)

Ric

#36 lore raw
Quoted 4 lines · Ric Wheeler

Then you end up with large directories and an extra name per inode that needs to be stored and extra lookups for each file when you do a whole file system crawl.

Certainly not as easy as adding and xattrs with that information :)

And I think there's another reason why it wouldn't work...

Imagine I change my system to encode what should be XATTRs in hardlink pseudo files...

If I have such pair locally e.g. on my ext4:
/foo/bar/actual/file
/meta/<SHA512 identifier>.2342348324

And now move/copy the file via the network to the archive, I'd have to copy both files (which is really annoying), and I'd guess the inode coupling would get los (and at least the name wouldn't fit anymore).

So the whole thing is IMHO not even a workaround.

Cheers,
Chris.

#37 lore raw
Quoted 15 lines · Christoph Anton Mitterer
Quoted 4 lines · Ric Wheeler

Then you end up with large directories and an extra name per inode that needs to be stored and extra lookups for each file when you do a whole file system crawl.

Certainly not as easy as adding and xattrs with that information :)

And I think there's another reason why it wouldn't work...

Imagine I change my system to encode what should be XATTRs in hardlink pseudo files...

If I have such pair locally e.g. on my ext4:
/foo/bar/actual/file
/meta/<SHA512 identifier>.2342348324

Quoted 5 lines

And now move/copy the file via the network to the archive, I'd have to copy both files (which is really annoying), and I'd guess the inode coupling would get los (and at least the name wouldn't fit anymore).

So the whole thing is IMHO not even a workaround.

OK. So you're going to do XATTRs for us?

Trond

#38 lore raw
Quoted 16 lines · Trond
Quoted 14 lines · Christoph Anton Mitterer
Quoted 4 lines · Ric Wheeler

Then you end up with large directories and an extra name per inode that needs to be stored and extra lookups for each file when you do a whole file system crawl.

Certainly not as easy as adding and xattrs with that information :)

And I think there's another reason why it wouldn't work...

Imagine I change my system to encode what should be XATTRs in hardlink pseudo files...

If I have such pair locally e.g. on my ext4:
/foo/bar/actual/file
/meta/<SHA512 identifier>.2342348324

Quoted 8 lines
Quoted 5 lines

And now move/copy the file via the network to the archive, I'd have to copy both files (which is really annoying), and I'd guess the inode coupling would get los (and at least the name wouldn't fit anymore).

So the whole thing is IMHO not even a workaround.

OK. So you're going to do XATTRs for us?

Trond

Now that pNFS is perfect and labeled NFS has made it upstream, I think that Steve D must be looking for something to keep him busy :)

ric

#39 lore raw
Quoted 21 lines · Ric Wheeler
Quoted 20 lines · Trond
Quoted 18 lines · Christoph Anton Mitterer
Quoted 4 lines · Ric Wheeler

Then you end up with large directories and an extra name per inode that needs to be stored and extra lookups for each file when you do a whole file system crawl.

Certainly not as easy as adding and xattrs with that information :)

And I think there's another reason why it wouldn't work...

Imagine I change my system to encode what should be XATTRs in hardlink pseudo files...

If I have such pair locally e.g. on my ext4:
/foo/bar/actual/file
/meta/<SHA512 identifier>.2342348324

And now move/copy the file via the network to the archive, I'd have to copy both files (which is really annoying), and I'd guess the inode coupling would get los (and at least the name wouldn't fit anymore).

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

So the whole thing is IMHO not even a workaround.

OK. So you're going to do XATTRs for us?

Trond

Now that pNFS is perfect and labeled NFS has made it upstream, I think that Steve D must be looking for something to keep him busy :)

I agree with Trond that we first really need good evidence about exactly who wants this and why.

--b.

#40 lore raw
Quoted 25 lines · Dr Fields James Bruce
Quoted 24 lines · Ric Wheeler
Quoted 23 lines · Trond
Quoted 14 lines · Christoph Anton Mitterer
Quoted 4 lines · Ric Wheeler

Then you end up with large directories and an extra name per inode that needs to be stored and extra lookups for each file when you do a whole file system crawl.

Certainly not as easy as adding and xattrs with that information :)

And I think there's another reason why it wouldn't work...

Imagine I change my system to encode what should be XATTRs in hardlink pseudo files...

If I have such pair locally e.g. on my ext4:
/foo/bar/actual/file
/meta/<SHA512 identifier>.2342348324

Quoted 5 lines

And now move/copy the file via the network to the archive, I'd have to copy both files (which is really annoying), and I'd guess the inode coupling would get los (and at least the name wouldn't fit anymore).

So the whole thing is IMHO not even a workaround.

OK. So you're going to do XATTRs for us?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Trond

Now that pNFS is perfect and labeled NFS has made it upstream, I think that Steve D must be looking for something to keep him busy :)

I agree with Trond that we first really need good evidence about exactly who wants this and why.

--b.

For the user space xattrs, many applications store various types of metadata. Gluster for example heavily uses xattrs, other programs do things like data scrubbing (look for a long unchanged file, compute a has and store it as an xattr) or simply use it to annotate the file with the name of the program that created it. Think of it as file decorations or annotations.

Today, if we store files in NFS that have xattrs, we do in fact cause data loss.

I can understand an answer of "this would be hard to do for NFS and need to go through IETF" but think that xattrs are well enough established in Linux and supported in the tool chain that it is way too late to question whether or not supporting them is a worth our time.

Ric

#41 lore raw

Hi Spencer,
Is it still possible to get on the agenda fir IETF 88, I just got approval to travel. We can use about 15 minutes, or what ever is available to discussion the future of named attributes in NFS. The two main questions that we need answer are:
1. Do we need them? what applications use them and how.
2. Can we have a more simple model that handles just user attributes.

Input is welcome to help me make the case at the meeting.

Thanks, Marc.

From:   Ric Wheeler <[email protected]>
To:     Dr Fields James Bruce <[email protected]>, 
Cc:     "Myklebust, Trond" <[email protected]>, Christoph Anton 
Mitterer <[email protected]>, Mailing List Linux NFS 
<[email protected]>, Steve Dickson <[email protected]>
Date:   10/28/2013 11:32 AM
Subject:        Re: XATTRs in NFS?
Sent by:        [email protected]
Quoted 3 lines · Dr Fields James Bruce
Quoted 2 lines · Ric Wheeler
Quoted 1 line · Trond

On Oct 28, 2013, at 12:15 PM, Christoph Anton Mitterer

Quoted 3 lines · <[email protected]> wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Ric Wheeler
Quoted 1 line

Then you end up with large directories and an extra name per inode

that needs to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

be stored and extra lookups for each file when you do a whole file

system crawl.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

Certainly not as easy as adding and xattrs with that information :)

And I think there's another reason why it wouldn't work...

Imagine I change my system to encode what should be XATTRs in

hardlink

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

pseudo files...

If I have such pair locally e.g. on my ext4:
/foo/bar/actual/file
/meta/<SHA512 identifier>.2342348324

And now move/copy the file via the network to the archive, I'd have

to

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

copy both files (which is really annoying), and I'd guess the inode coupling would get los (and at least the name wouldn't fit anymore).

So the whole thing is IMHO not even a workaround.

OK. So you're going to do XATTRs for us?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Trond

Now that pNFS is perfect and labeled NFS has made it upstream, I think that Steve D must be looking for something to keep him busy :)

I agree with Trond that we first really need good evidence about exactly who wants this and why.

--b.

For the user space xattrs, many applications store various types of metadata.
Gluster for example heavily uses xattrs, other programs do things like data
scrubbing (look for a long unchanged file, compute a has and store it as an
xattr) or simply use it to annotate the file with the name of the program that
created it. Think of it as file decorations or annotations.

Today, if we store files in NFS that have xattrs, we do in fact cause data loss.

I can understand an answer of "this would be hard to do for NFS and need to go
through IETF" but think that xattrs are well enough established in Linux and
supported in the tool chain that it is way too late to question whether or not
supporting them is a worth our time.

Ric

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#42 lore raw
Quoted 8 lines · Marc Eshel

Hi Spencer,
Is it still possible to get on the agenda fir IETF 88, I just got approval to travel. We can use about 15 minutes, or what ever is available to discussion the future of named attributes in NFS. The two main questions that we need answer are:
1. Do we need them? what applications use them and how.
2. Can we have a more simple model that handles just user attributes.

Quoted 4 lines

Input is welcome to help me make the case at the meeting.

Thanks, Marc.

Be sure to call out why they currently do or do not work.

#43 lore raw
Quoted 11 lines · Tom
Quoted 8 lines · Marc Eshel

Hi Spencer,
Is it still possible to get on the agenda fir IETF 88, I just got approval to travel. We can use about 15 minutes, or what ever is available to discussion the future of named attributes in NFS. The two main questions that we need answer are:
1. Do we need them? what applications use them and how.
2. Can we have a more simple model that handles just user attributes.

Quoted 7 lines
Quoted 4 lines

Input is welcome to help me make the case at the meeting.

Thanks, Marc.

Be sure to call out why they currently do or do not work.

And we also need to keep clear the distinctions between:

- NFSv4 named attributes/streams/forks and "extended attributes" as implemented in Linux and elsewhere.
- user.* xattrs and "back-door ioctls".

(Your description above seems to confuse named attributes and Linux extended attributes.)

--b.

#44 lore raw
Quoted 20 lines · J. Bruce Fields
Quoted 11 lines · Tom
Quoted 8 lines · Marc Eshel

Hi Spencer,
Is it still possible to get on the agenda fir IETF 88, I just got approval to travel. We can use about 15 minutes, or what ever is available to discussion the future of named attributes in NFS. The two main questions that we need answer are:
1. Do we need them? what applications use them and how.
2. Can we have a more simple model that handles just user attributes.

Quoted 7 lines
Quoted 4 lines

Input is welcome to help me make the case at the meeting.

Thanks, Marc.

Be sure to call out why they currently do or do not work.

Quoted 8 lines

And we also need to keep clear the distinctions between:

- NFSv4 named attributes/streams/forks and "extended attributes" as implemented in Linux and elsewhere.
- user.* xattrs and "back-door ioctls".

(Your description above seems to confuse named attributes and Linux extended attributes.)

I wonder if we will have a balanced discussion next week. The people who seem to know the most about these issues on Linux will not be attending. Perhaps it would be better to start this discussion on the mailing list instead.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

#45 lore raw

[email protected] wrote on 10/28/2013 02:04:57 PM:

Quoted 16 lines

From: Chuck Lever <[email protected]>
To: "J. Bruce Fields" <[email protected]>,
Cc: "Haynes, Tom" <[email protected]>, Marc Eshel/Almaden/ IBM@IBMUS, Spencer Shepler <[email protected]>, Mailing List Linux NFS <[email protected]>, Christoph Anton Mitterer <[email protected]>, "Myklebust, Trond" <[email protected]>, Steve Dickson <[email protected]>, "[email protected] [email protected]" <[email protected]>, Ric Wheeler <[email protected]>, "[email protected]" <linux- [email protected]>
Date: 10/28/2013 02:07 PM
Subject: Re: [nfsv4] XATTRs in NFS?
Sent by: [email protected]

On Oct 28, 2013, at 5:02 PM, "J. Bruce Fields" <[email protected]>

Quoted 11 lines · wrote:
Quoted 7 lines · Tom
Quoted 5 lines · Marc Eshel
Quoted 3 lines

Hi Spencer,
Is it still possible to get on the agenda fir IETF 88, I just

got approval

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

to travel. We can use about 15 minutes, or what ever is available to

discussion the future of named attributes in NFS. The two main

questions

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

that we need answer are:
1. Do we need them? what applications use them and how.
2. Can we have a more simple model that handles just user

attributes.

Quoted 15 lines
Quoted 15 lines
Quoted 8 lines
Quoted 5 lines

Input is welcome to help me make the case at the meeting.

Thanks, Marc.

Be sure to call out why they currently do or do not work.

And we also need to keep clear the distinctions between:

- NFSv4 named attributes/streams/forks and "extended attributes" as implemented in Linux and elsewhere.
- user.* xattrs and "back-door ioctls".

Quoted 7 lines
Quoted 2 lines

(Your description above seems to confuse named attributes and Linux extended attributes.)

I wonder if we will have a balanced discussion next week. The people who seem to know the most about these issues on Linux will not be attending. Perhaps it would be better to start this discussion on the mailing list instead.

Like I said input is welcome to the mailing list and I can try to collect all the main points into a presentation at the IETF. The main objective for now is to see if this is an item for the working group to start dealing with for future NFS protocol enhancements.
Marc.

Quoted 7 lines

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

_______________________________________________
nfsv4 mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/nfsv4

A message that is not in the archive (sent off-list or not yet received): OF3A48E6D9.7BB93CB0-ON88257C12.0075527E-88257C12.0075F065@LocalDomain

#47 lore raw

XATTRs in NFS

This is a clean start to discuss extended attributes over NFS in the mailing list first.

1. What are the requirements and why? which applications are using them and how.
2. Why are current named attributes in NFS not the right answer.
3. What does the new protocol enhancements should look like?

Marc.

_______________________________________________
nfsv4 mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/nfsv4

#48 lore raw

XATTRs in NFS

This is a clean start to discuss extended attributes over NFS in the mailing list first.

1. What are the requirements and why? which applications are using them and how.
2. Why are current named attributes in NFS not the right answer.
3. What does the new protocol enhancements should look like?

Thanks, Marc.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#50 lore raw

Re: XATTRs in NFS

Quoted 11 lines

-------- Original Message --------

Subject:     XATTRs in NFS
Date:     Mon, 28 Oct 2013 15:41:37 -0700
From:     Marc Eshel <[email protected]>
To:     Marc Eshel <[email protected]>

CC: Mailing List Linux NFS <[email protected]>,
[email protected], [email protected]

Quoted 5 lines

This is a clean start to discuss extended attributes over NFS in the mailing list first.

1. What are the requirements and why? which applications are using them and how.

Reiterating, one of the applications (glusterfs - a distributed filesystem) has been using filesystems with extended attribute support by annotating files and dirs with crucial info for its operation (uses xattrs as a dumb key/value store). Usage of xattrs is crucial for the operation as glusterfs avoids using any sort of "external" meta-data database or metadata server for its operation (as a philosophy/design principle focused on robustness). Lack of xattrs on NFS prevents using NFS volumes as gluster bricks.

To that end, if NFS can map user.XXX values to user.XXX named attributes and vice versa in the NFS client and NFS server respectively, that would make NFS volumes be usable as gluster bricks.

Quoted 1 line

2. Why are current named attributes in NFS not the right answer.

I think they might be, if we can map user.XXXX xattrs to named attributes and avoid any sort of interpretation of they key/values by NFS. Though from my point of view, all I care is for getxattr/setxattr of user.XXX keys to "just work" (whether they are mapped to named attributes or implemented as a separate feature).

Avati

Quoted 4 lines

3. What does the new protocol enhancements should look like?

Thanks, Marc.

#51 lore raw

Re: [nfsv4] XATTRs in NFS

Quoted 7 lines · Anand Avati
Quoted 1 line

2. Why are current named attributes in NFS not the right answer.

I think they might be, if we can map user.XXXX xattrs to named attributes and avoid any sort of interpretation of they key/values by NFS. Though from my point of view, all I care is for getxattr/setxattr of user.XXX keys to "just work" (whether they are mapped to named attributes or implemented as a separate feature).

That's an open question. Are writes to xattrs supposed to be atomic?

Anyways, it seems at least one filesystem (XFS) maps xattrs onto a hidden data fork (named attribute) for that purpose. So, I'm guessing:
a) no, they're not atomic, b) named attributes should work... c) if only we had a namespace to steal names from for this purpose.

Nico

#52 lore raw

Re: [nfsv4] XATTRs in NFS

In reply to Marc Eshel
Quoted 5 lines · Marc Eshel

This is a clean start to discuss extended attributes over NFS in the mailing list first.

1. What are the requirements and why? which applications are using them and how.

Surely the requirements would be semantic compatibility with Linux's xattrs. These are defined in manpages such as getxattr(2). Links can be easily found online.

: ; man -s2 -k xattr

fgetxattr (2)        - retrieve an extended attribute value
flistxattr (2)       - list extended attribute names
fremovexattr (2)     - remove an extended attribute
fsetxattr (2)        - set an extended attribute value
getxattr (2)         - retrieve an extended attribute value
lgetxattr (2)        - retrieve an extended attribute value
listxattr (2)        - list extended attribute names
llistxattr (2)       - list extended attribute names
lremovexattr (2)     - remove an extended attribute
lsetxattr (2)        - set an extended attribute value
removexattr (2)      - remove an extended attribute
setxattr (2)         - set an extended attribute value

: ;

Whether there are apps that use them is a different story. I've no idea, but here's a github search for code using getxattr:

https://github.com/search?q=getxattr&ref=cmdform&type=Code

Many of the results are from clones of Android, so one has to wade a fair bit to find apps. Things like this:

https://github.com/protonet/xattr
https://github.com/jarib/ffi-xattr

make it harder to tell what's using them.

Then we have:

https://github.com/search?q=getxattr&ref=cmdform&type=Issues

which is a bit better, since this brings up more issues with apps using xattrs and fewer about implementations of xattrs, like:

https://github.com/Cocoanetics/DTFoundation/issues/37

Even then, most of the issues (only 5 pages) relate to filesystems and FUSE.

Interesting data point: both, an OS X port of ZFS, and ZFSOnLinux felt the need to add support for xattrs.

The only apps I found this way are the above DTFoundation, Ruby FFI bindings of xattrs, and:

https://github.com/tobiaswaldvogel/openwrt-addpack
https://github.com/mxcl/homebrew
https://github.com/scrod/nv
https://github.com/ShareKit/ShareKit

Quoted 1 line

2. Why are current named attributes in NFS not the right answer.

They have different semantics and namespaces.

xattrs are small, bite-sized.

Named attributes as files within files -"forks"- and align well with openat(2) but not with *xattr(2).

Quoted 1 line

3. What does the new protocol enhancements should look like?

Probably like direct equivalents of the xattrs system calls as OPs operating on the current FH. This seems like the simplest question to answer.

I'm not advocating adding xattrs to the protocol. I'm not sure there's a real case for this. Developers ought to be using openat(2) more and xattrs less. Forks interop better with, e.g., Win32, than xattrs.

Perhaps xattrs could be implemented as a conventional mapping onto named attributes. This would require agreement by many people, including implementors of filesystems that already have both features, so it seems unlikely, except, perhaps, via reserving named attribute namespace for implementation purposes, but even that I think is (IIRC) not allowable for NFSv4 (i.e., the named attribute namespace is already wide open for use by the public).

This really brings up a different matter: to the extent that xattrs and named attributes are used to store application data (as opposed to arbitrary user-named attributes) perhaps we ought to have a registry for naming them.

Nico

#53 lore raw
In reply to J. Bruce Fields

"J. Bruce Fields" <[email protected]> wrote on 10/28/2013 02:02:47 PM:

Quoted 13 lines

From: "J. Bruce Fields" <[email protected]>
To: "Haynes, Tom" <[email protected]>,
Cc: Marc Eshel/Almaden/IBM@IBMUS, Spencer Shepler <[email protected]>, Mailing List Linux NFS <linux- [email protected]>, Christoph Anton Mitterer <[email protected]>, "Myklebust, Trond" <[email protected]>, Steve Dickson <[email protected]>, "[email protected] [email protected]" <[email protected]>, Ric Wheeler <[email protected]>, "[email protected]" <linux- [email protected]>
Date: 10/28/2013 02:02 PM
Subject: Re: [nfsv4] XATTRs in NFS?

Quoted 10 lines
Quoted 5 lines · Tom
Quoted 2 lines · Marc Eshel

Hi Spencer,
Is it still possible to get on the agenda fir IETF 88, I just

got approval

Quoted 3 lines
Quoted 3 lines

to travel. We can use about 15 minutes, or what ever is available to

discussion the future of named attributes in NFS. The two main

questions

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

that we need answer are:
1. Do we need them? what applications use them and how.
2. Can we have a more simple model that handles just user

attributes.

Quoted 9 lines
Quoted 8 lines
Quoted 5 lines

Input is welcome to help me make the case at the meeting.

Thanks, Marc.

Be sure to call out why they currently do or do not work.

Quoted 8 lines

And we also need to keep clear the distinctions between:

- NFSv4 named attributes/streams/forks and "extended attributes" as implemented in Linux and elsewhere.
- user.* xattrs and "back-door ioctls".

(Your description above seems to confuse named attributes and Linux extended attributes.)

Yes, I used user which is the Linux type of xattr but what I meant is somthing like the Linux user attributes with no special meaning to NFS, so NFS can be used to just transfer opaque attributes.
Marc.

Quoted 3 lines

--b.

_______________________________________________
nfsv4 mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/nfsv4

#54 lore raw
In reply to Marc Eshel

Hi, Marc.

At this point the agenda is full .. based on maximum time. But I am open to shifting things around a little if the other presenters are willing to adjust their time allotment.

I suggest that you and I work this together off the cc'd aliases and you can send a summary when we work out the details.

Spencer

Quoted 110 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Marc Eshel
Sent: Monday, October 28, 2013 1:44 PM
To: [email protected]
Cc: Mailing List Linux NFS; Christoph Anton Mitterer; Myklebust, Trond; Steve Dickson; [email protected]; Dr Fields James Bruce; Ric Wheeler; linux-nfs- [email protected]
Subject: Re: [nfsv4] XATTRs in NFS?

Hi Spencer,
Is it still possible to get on the agenda fir IETF 88, I just got approval to travel. We can use about 15 minutes, or what ever is available to discussion the future of named attributes in NFS. The two main questions that we need answer are:
1. Do we need them? what applications use them and how.
2. Can we have a more simple model that handles just user attributes.

Input is welcome to help me make the case at the meeting.

Thanks, Marc.

From:   Ric Wheeler <[email protected]>
To:     Dr Fields James Bruce <[email protected]>,

Cc: "Myklebust, Trond" <[email protected]>, Christoph
Anton
Mitterer <[email protected]>, Mailing List Linux NFS <linux- [email protected]>, Steve Dickson <[email protected]>

Date:   10/28/2013 11:32 AM
Subject:        Re: XATTRs in NFS?
Sent by:        [email protected]
Quoted 3 lines · Dr Fields James Bruce
Quoted 2 lines · Ric Wheeler
Quoted 1 line · Trond

On Oct 28, 2013, at 12:15 PM, Christoph Anton Mitterer

Quoted 3 lines · <[email protected]> wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Ric Wheeler
Quoted 1 line

Then you end up with large directories and an extra name per inode

that needs to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

be stored and extra lookups for each file when you do a whole file

system crawl.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

Certainly not as easy as adding and xattrs with that information :)

And I think there's another reason why it wouldn't work...

Imagine I change my system to encode what should be XATTRs in

hardlink

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

pseudo files...

If I have such pair locally e.g. on my ext4:
/foo/bar/actual/file
/meta/<SHA512 identifier>.2342348324

And now move/copy the file via the network to the archive, I'd have

to

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

copy both files (which is really annoying), and I'd guess the inode coupling would get los (and at least the name wouldn't fit anymore).

So the whole thing is IMHO not even a workaround.

OK. So you're going to do XATTRs for us?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Trond

Now that pNFS is perfect and labeled NFS has made it upstream, I think that Steve D must be looking for something to keep him busy :)

I agree with Trond that we first really need good evidence about exactly who wants this and why.

--b.

For the user space xattrs, many applications store various types of metadata.
Gluster for example heavily uses xattrs, other programs do things like data
scrubbing (look for a long unchanged file, compute a has and store it as an
xattr) or simply use it to annotate the file with the name of the program that
created it. Think of it as file decorations or annotations.

Today, if we store files in NFS that have xattrs, we do in fact cause data loss.

I can understand an answer of "this would be hard to do for NFS and need to go
through IETF" but think that xattrs are well enough established in Linux and
supported in the tool chain that it is way too late to question whether or not
supporting them is a worth our time.

Ric

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

_______________________________________________
nfsv4 mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/nfsv4

A message that is not in the archive (sent off-list or not yet received): [email protected]

#56 lore raw
Quoted 28 lines · Ric Wheeler
Quoted 27 lines · Ric Wheeler
Quoted 1 line · Trond

On Oct 28, 2013, at 12:15 PM, Christoph Anton Mitterer

Quoted 3 lines · <[email protected]> wrote:
Quoted 3 lines · Ric Wheeler
Quoted 1 line

Then you end up with large directories and an extra name per inode

that needs to

Quoted 1 line
Quoted 1 line
Quoted 1 line

be stored and extra lookups for each file when you do a whole file

system crawl.

Quoted 18 lines
Quoted 11 lines
Quoted 2 lines

Certainly not as easy as adding and xattrs with that information :)

And I think there's another reason why it wouldn't work...

Imagine I change my system to encode what should be XATTRs in hardlink pseudo files...

If I have such pair locally e.g. on my ext4:
/foo/bar/actual/file
/meta/<SHA512 identifier>.2342348324

Quoted 5 lines

And now move/copy the file via the network to the archive, I'd have to copy both files (which is really annoying), and I'd guess the inode coupling would get los (and at least the name wouldn't fit anymore).

So the whole thing is IMHO not even a workaround.

OK. So you're going to do XATTRs for us?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Trond

Now that pNFS is perfect and labeled NFS has made it upstream, I think that Steve D must be looking for something to keep him busy :)

I agree with Trond that we first really need good evidence about exactly who wants this and why.

Some reasons why XATTRs in NFS could be useful w/ glusterfs:

- glusterfs exposes data locality through virtual extended attributes. One could do a getxattr("filename", "glusterfs.pathinfo") and get a parsable response about which servers store what parts and copies of the file. Such a mechanism is already used to implement Hadoop plugins for example (Hadoop plugin internally mounts gluster through FUSE where xattrs work). In some use-cases we really want to use NFS and still retain the ability to expose data locality through virtual xattrs, but lack of xattr support limits that possibility.

- gluster implements a "merkel tree" like inode attribute called "xtime" which is the recursive max mtime of all files/dirs in a subtree, maintained in real-time on all dirs. This is an extremely handy and powerful feature for implementing backups. This xtime is both stored as an xattr and exposed as an xattr. Users who chose to mount gluster through NFS protocol are giving up access this feature which is available only through xattrs.

- A very similar recursive function also provided by gluster is real-time size of dir subtrees, also exposed as extended attributes. For e.g a user instead of doing "du -hs /mnt/gluster/some/subdir" can instead do "getfattr -n glusterfs.quota.size /mnt/gluster/some/dir" and get instantaneous results. Again such a feature is not available for users mounting through NFS because of the lack of generic xattrs.

- A lot of our users have asked many times for the ability to use existing NFS servers as "gluster bricks" - because they have paid a ton of money and/or have a lot of data in there and do not want to "move it out". A major roadblocker for such a use case is the lack of xattr support. Gluster stores a lot of metadata in xattrs and therefore avoids having a "metadata server" (for e.g it stores details about which of the copies of a file/dir is fresh and stale in xattrs of that inode, it stores "hash ranges" of directories as xattrs on the directory inode, etc.) If only NFS mounts supported storing of these xattrs, we could support pre-existing NFS volumes as gluster bricks.

These are just some reasons on how implementing xattrs in NFS can be useful to one project.

It would be interesting to see how the server can control the caching behavior of such xattrs. For ex some of the (virtual) xattrs are better not cached by the client ever.

Avati

#57 lore raw

I might add a similar use case which we have at the faculty respectively the local supercomputing centre:

What we have there is big cluster filesystems (used to be Lustre but nowadays I think they use GPFS).
There are custom (i.e. local) applications where XATTRs are used to attach some metadata to files, which works fine in these cluster filesystems since they have native support.

Now what they sometimes do (AFAIU) is, export the cluster fs via NFS, to nodes which don't have support for the cluster fs itself (sometimes the OS is simply too old, but one common use case is also, that they simply don't allow direct mounts outside of e.g. the super computer).

At that point, NFS looses the XATTRs.

Cheers,
Chris.

#58 lore raw
Quoted 9 lines · Christoph Anton Mitterer

I might add a similar use case which we have at the faculty respectively the local supercomputing centre:

What we have there is big cluster filesystems (used to be Lustre but nowadays I think they use GPFS).
There are custom (i.e. local) applications where XATTRs are used to attach some metadata to files, which works fine in these cluster filesystems since they have native support.

Quoted 6 lines

Now what they sometimes do (AFAIU) is, export the cluster fs via NFS, to nodes which don't have support for the cluster fs itself (sometimes the OS is simply too old, but one common use case is also, that they simply don't allow direct mounts outside of e.g. the super computer).

At that point, NFS looses the XATTRs.

Why do these nodes need access to the xattrs? What applications are they running that need them? Why can't those applications run on the native cluster instead?

Trond

#59 lore raw
Quoted 1 line · Trond

Why do these nodes need access to the xattrs?

I have no concrete idea... I just know what these guys are doing not why... AFAIK the files resembles event collections from scientific measurements,... and what they store is how these events have been processed.
I do not even claim that this couldn't be done otherwise... it's just how things are.

Quoted 1 line

What applications are they running that need them?

Home brew event processing software...

Quoted 1 line

Why can't those applications run on the native cluster instead?

That's largely politics and money...
The super computer is highly expensive and you only get time there after you've made a official proposal and a commission has granted you're request.
So while some of the data lies there in the shared fs (the GPFS),... people also want to process the data from the normal Linux cluster (where getting computing time is far more easy)... so they somehow need to access the data which is done via the NFS exports.

Don't get me wrong, Trond, I'm not saying that this is the only or best solution... I say this is how things are done in reality. Obviously they must have found some workaround now... but I just wanted to point out that there *are* some use cases, whether they're perfect or not.

Cheers,
Chris.

#60 lore raw
In reply to Anand Avati
Quoted 46 lines · Anand Avati
Quoted 28 lines · Ric Wheeler
Quoted 27 lines · Ric Wheeler
Quoted 1 line · Trond

On Oct 28, 2013, at 12:15 PM, Christoph Anton Mitterer

Quoted 3 lines · <[email protected]> wrote:
Quoted 3 lines · Ric Wheeler
Quoted 1 line

Then you end up with large directories and an extra name per inode

that needs to

Quoted 1 line
Quoted 1 line
Quoted 1 line

be stored and extra lookups for each file when you do a whole file

system crawl.

Quoted 18 lines
Quoted 11 lines
Quoted 2 lines

Certainly not as easy as adding and xattrs with that information :)

And I think there's another reason why it wouldn't work...

Imagine I change my system to encode what should be XATTRs in hardlink pseudo files...

If I have such pair locally e.g. on my ext4:
/foo/bar/actual/file
/meta/<SHA512 identifier>.2342348324

Quoted 5 lines

And now move/copy the file via the network to the archive, I'd have to copy both files (which is really annoying), and I'd guess the inode coupling would get los (and at least the name wouldn't fit anymore).

So the whole thing is IMHO not even a workaround.

OK. So you're going to do XATTRs for us?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Trond

Now that pNFS is perfect and labeled NFS has made it upstream, I think that Steve D must be looking for something to keep him busy :)

I agree with Trond that we first really need good evidence about exactly who wants this and why.

Some reasons why XATTRs in NFS could be useful w/ glusterfs:

- glusterfs exposes data locality through virtual extended attributes. One could do a getxattr("filename", "glusterfs.pathinfo") and get a parsable response about which servers store what parts and copies of the file. Such a mechanism is already used to implement Hadoop plugins for example (Hadoop plugin internally mounts gluster through FUSE where xattrs work). In some use-cases we really want to use NFS and still retain the ability to expose data locality through virtual xattrs, but lack of xattr support limits that possibility.

- gluster implements a "merkel tree" like inode attribute called "xtime" which is the recursive max mtime of all files/dirs in a subtree, maintained in real-time on all dirs. This is an extremely handy and powerful feature for implementing backups. This xtime is both stored as an xattr and exposed as an xattr. Users who chose to mount gluster through NFS protocol are giving up access this feature which is available only through xattrs.

- A very similar recursive function also provided by gluster is real-time size of dir subtrees, also exposed as extended attributes. For e.g a user instead of doing "du -hs /mnt/gluster/some/subdir" can instead do "getfattr -n glusterfs.quota.size /mnt/gluster/some/dir" and get instantaneous results. Again such a feature is not available for users mounting through NFS because of the lack of generic xattrs.

Quoted 7 lines

- A lot of our users have asked many times for the ability to use existing NFS servers as "gluster bricks" - because they have paid a ton of money and/or have a lot of data in there and do not want to "move it out". A major roadblocker for such a use case is the lack of xattr support. Gluster stores a lot of metadata in xattrs and therefore avoids having a "metadata server" (for e.g it stores details about which of the copies of a file/dir is fresh and stale in xattrs of that inode, it stores "hash ranges" of directories as xattrs on the directory inode, etc.) If only NFS mounts supported storing of these xattrs, we could support pre-existing NFS volumes as gluster bricks.

These are just some reasons on how implementing xattrs in NFS can be useful to one project.

It would be interesting to see how the server can control the caching behavior of such xattrs. For ex some of the (virtual) xattrs are better not cached by the client ever.

Avati

..and here is a perfect example of exactly what is wrong with xattrs. You're describing a private syscall interface, not a data storage format.

Trond

#61 lore raw
Quoted 45 lines · Trond
Quoted 43 lines · Anand Avati
Quoted 23 lines · Ric Wheeler
Quoted 22 lines · Ric Wheeler
Quoted 1 line · Trond

On Oct 28, 2013, at 12:15 PM, Christoph Anton Mitterer

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines · Ric Wheeler
Quoted 1 line

Then you end up with large directories and an extra name per inode

that needs to

Quoted 1 line
Quoted 1 line
Quoted 1 line

be stored and extra lookups for each file when you do a whole file

system crawl.

Quoted 14 lines
Quoted 14 lines
Quoted 1 line

Certainly not as easy as adding and xattrs with that information :)

And I think there's another reason why it wouldn't work...

Imagine I change my system to encode what should be XATTRs in hardlink pseudo files...

If I have such pair locally e.g. on my ext4:
/foo/bar/actual/file
/meta/<SHA512 identifier>.2342348324

And now move/copy the file via the network to the archive, I'd have to copy both files (which is really annoying), and I'd guess the inode coupling would get los (and at least the name wouldn't fit anymore).

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

So the whole thing is IMHO not even a workaround.

OK. So you're going to do XATTRs for us?

Trond

Now that pNFS is perfect and labeled NFS has made it upstream, I think that Steve D must be looking for something to keep him busy :)

I agree with Trond that we first really need good evidence about exactly who wants this and why.

Some reasons why XATTRs in NFS could be useful w/ glusterfs:

- glusterfs exposes data locality through virtual extended attributes. One could do a getxattr("filename", "glusterfs.pathinfo") and get a parsable response about which servers store what parts and copies of the file. Such a mechanism is already used to implement Hadoop plugins for example (Hadoop plugin internally mounts gluster through FUSE where xattrs work). In some use-cases we really want to use NFS and still retain the ability to expose data locality through virtual xattrs, but lack of xattr support limits that possibility.

- gluster implements a "merkel tree" like inode attribute called "xtime" which is the recursive max mtime of all files/dirs in a subtree, maintained in real-time on all dirs. This is an extremely handy and powerful feature for implementing backups. This xtime is both stored as an xattr and exposed as an xattr. Users who chose to mount gluster through NFS protocol are giving up access this feature which is available only through xattrs.

- A very similar recursive function also provided by gluster is real-time size of dir subtrees, also exposed as extended attributes. For e.g a user instead of doing "du -hs /mnt/gluster/some/subdir" can instead do "getfattr -n glusterfs.quota.size /mnt/gluster/some/dir" and get instantaneous results. Again such a feature is not available for users mounting through NFS because of the lack of generic xattrs.

- A lot of our users have asked many times for the ability to use existing NFS servers as "gluster bricks" - because they have paid a ton of money and/or have a lot of data in there and do not want to "move it out". A major roadblocker for such a use case is the lack of xattr support. Gluster stores a lot of metadata in xattrs and therefore avoids having a "metadata server" (for e.g it stores details about which of the copies of a file/dir is fresh and stale in xattrs of that inode, it stores "hash ranges" of directories as xattrs on the directory inode, etc.) If only NFS mounts supported storing of these xattrs, we could support pre-existing NFS volumes as gluster bricks.

Quoted 8 lines
Quoted 5 lines

These are just some reasons on how implementing xattrs in NFS can be useful to one project.

It would be interesting to see how the server can control the caching behavior of such xattrs. For ex some of the (virtual) xattrs are better not cached by the client ever.

Avati

..and here is a perfect example of exactly what is wrong with xattrs. You're describing a private syscall interface, not a data storage format.

Trond

What Avati described is having an application store user defined attributes in a file in a standard way - pretty much every local file system does this. I don't get the private syscall interface comment or the need to re-argue a battle that was waged and lost effectively *years* ago :)

Ric

#62 lore raw
Quoted 48 lines · Ric Wheeler
Quoted 47 lines · Trond
Quoted 45 lines · Anand Avati
Quoted 23 lines · Ric Wheeler
Quoted 22 lines · Ric Wheeler
Quoted 1 line · Trond

On Oct 28, 2013, at 12:15 PM, Christoph Anton Mitterer

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines · Ric Wheeler
Quoted 1 line

Then you end up with large directories and an extra name per inode

that needs to

Quoted 1 line
Quoted 1 line
Quoted 1 line

be stored and extra lookups for each file when you do a whole file

system crawl.

Quoted 14 lines
Quoted 14 lines
Quoted 1 line

Certainly not as easy as adding and xattrs with that information :)

And I think there's another reason why it wouldn't work...

Imagine I change my system to encode what should be XATTRs in hardlink pseudo files...

If I have such pair locally e.g. on my ext4:
/foo/bar/actual/file
/meta/<SHA512 identifier>.2342348324

And now move/copy the file via the network to the archive, I'd have to copy both files (which is really annoying), and I'd guess the inode coupling would get los (and at least the name wouldn't fit anymore).

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

So the whole thing is IMHO not even a workaround.

OK. So you're going to do XATTRs for us?

Trond

Now that pNFS is perfect and labeled NFS has made it upstream, I think that Steve D must be looking for something to keep him busy :)

I agree with Trond that we first really need good evidence about exactly who wants this and why.

Some reasons why XATTRs in NFS could be useful w/ glusterfs:

- glusterfs exposes data locality through virtual extended attributes. One could do a getxattr("filename", "glusterfs.pathinfo") and get a parsable response about which servers store what parts and copies of the file. Such a mechanism is already used to implement Hadoop plugins for example (Hadoop plugin internally mounts gluster through FUSE where xattrs work). In some use-cases we really want to use NFS and still retain the ability to expose data locality through virtual xattrs, but lack of xattr support limits that possibility.

- gluster implements a "merkel tree" like inode attribute called "xtime" which is the recursive max mtime of all files/dirs in a subtree, maintained in real-time on all dirs. This is an extremely handy and powerful feature for implementing backups. This xtime is both stored as an xattr and exposed as an xattr. Users who chose to mount gluster through NFS protocol are giving up access this feature which is available only through xattrs.

- A very similar recursive function also provided by gluster is real-time size of dir subtrees, also exposed as extended attributes. For e.g a user instead of doing "du -hs /mnt/gluster/some/subdir" can instead do "getfattr -n glusterfs.quota.size /mnt/gluster/some/dir" and get instantaneous results. Again such a feature is not available for users mounting through NFS because of the lack of generic xattrs.

- A lot of our users have asked many times for the ability to use existing NFS servers as "gluster bricks" - because they have paid a ton of money and/or have a lot of data in there and do not want to "move it out". A major roadblocker for such a use case is the lack of xattr support. Gluster stores a lot of metadata in xattrs and therefore avoids having a "metadata server" (for e.g it stores details about which of the copies of a file/dir is fresh and stale in xattrs of that inode, it stores "hash ranges" of directories as xattrs on the directory inode, etc.) If only NFS mounts supported storing of these xattrs, we could support pre-existing NFS volumes as gluster bricks.

These are just some reasons on how implementing xattrs in NFS can be useful to one project.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

It would be interesting to see how the server can control the caching behavior of such xattrs. For ex some of the (virtual) xattrs are better not cached by the client ever.

Avati

..and here is a perfect example of exactly what is wrong with xattrs. You're describing a private syscall interface, not a data storage format.

Trond

What Avati described is having an application store user defined attributes in a file in a standard way - pretty much every local file system does this. I don't get the private syscall interface comment or the need to re-argue a battle that was waged and lost effectively *years* ago :)

That battle may have been fought and won within the glusterfs community, but why should we wave the white flag without a discussion? I don't see how what he described above has anything to do with user defined attributes. He's describing how he wants to export quota information and xtime through a private xattr interface that is currently unique to glusterfs. How is that not a private syscall interface?

Which of the mainstream filesystems have their own private xattr namespaces like the above?

Trond

#63 lore raw
Quoted 3 lines · Trond

That battle may have been fought and won within the glusterfs community, but why should we wave the white flag without a discussion? I don't see how what he described above has anything to do with user defined attributes. He's describing how he wants to export quota information and xtime through a private xattr interface that is currently unique to glusterfs. How is that not a private syscall interface?

Exposing quota informtion is use "from the top". Note the other point I mention about using NFS volumes as "gluster bricks" where we store xattrs as dumb and persistent key/values associated with file/dir inodes (fresh/stale info for replication, hash ranges for dirs, quota acconting info per-dir, xtime per dir).

Quoted 2 lines

Which of the mainstream filesystems have their own private xattr namespaces like the above?

Why should NFS need to worry? As long as it acts like a pass-through (like every other call it supports).

Avati

#64 lore raw
Quoted 6 lines · Anand Avati
Quoted 3 lines · Trond

That battle may have been fought and won within the glusterfs community, but why should we wave the white flag without a discussion? I don't see how what he described above has anything to do with user defined attributes. He's describing how he wants to export quota information and xtime through a private xattr interface that is currently unique to glusterfs. How is that not a private syscall interface?

Quoted 6 lines

Exposing quota informtion is use "from the top". Note the other point I mention about using NFS volumes as "gluster bricks" where we store xattrs as dumb and persistent key/values associated with file/dir inodes (fresh/stale info for replication, hash ranges for dirs, quota acconting info per-dir, xtime per dir).

Quoted 2 lines

Which of the mainstream filesystems have their own private xattr namespaces like the above?

Why should NFS need to worry? As long as it acts like a pass-through (like every other call it supports).

We need to worry because we don't know what side-effects your private interface will have. How does it affect our caching model? How do we debug any problems that arise? Are there any security implications that we need to know about?

Trond

#65 lore raw

(Sorry for top post)

Ah, note that by "glusterfs.<something>" i was meaning "<ns>.glusterfs.<something>" where <ns> is like "user". It just needs to be a mechanism to store key values on the inode.

Avati

Sent from my Android phone using TouchDown (www.nitrodesk.com)

-----Original Message-----
From: Myklebust, Trond [[email protected]]
Received: Monday, 28 Oct 2013, 18:52
To: Anand Avati [[email protected]]
CC: Wheeler Ric [[email protected]]; Dr Fields James Bruce [[email protected]]; Christoph Anton Mitterer [[email protected]]; Mailing List Linux NFS [[email protected]]; Dickson Steve [[email protected]]
Subject: Re: XATTRs in NFS?

Quoted 6 lines · Anand Avati
Quoted 3 lines · Trond

That battle may have been fought and won within the glusterfs community, but why should we wave the white flag without a discussion? I don't see how what he described above has anything to do with user defined attributes. He's describing how he wants to export quota information and xtime through a private xattr interface that is currently unique to glusterfs. How is that not a private syscall interface?

Quoted 6 lines

Exposing quota informtion is use "from the top". Note the other point I mention about using NFS volumes as "gluster bricks" where we store xattrs as dumb and persistent key/values associated with file/dir inodes (fresh/stale info for replication, hash ranges for dirs, quota acconting info per-dir, xtime per dir).

Quoted 2 lines

Which of the mainstream filesystems have their own private xattr namespaces like the above?

Why should NFS need to worry? As long as it acts like a pass-through (like every other call it supports).

We need to worry because we don't know what side-effects your private interface will have. How does it affect our caching model? How do we debug any problems that arise? Are there any security implications that we need to know about?

Trond

#66 lore raw
In reply to Myklebust, Trond

Trond,... since you ask for motivations pro NFS-XATTRs, I wondered what are the strong reasons against?

Of course someone has to do the work,... but that's not really and argument pro or con NFS-XATTRs, is it?

The security problems with namespaces like trusted. or so can probably be solved quite easy, e.g. simply by not supporting or ignoring/rejecting them.

You've mentioned caching issues,... could you elaborate a bit on that? How is that much different from caching any other file metadata NFS transfers?

Are there other (technical) reasons?

Cheers,
Chris.

#67 lore raw
Quoted 2 lines · Christoph Anton Mitterer

Trond,... since you ask for motivations pro NFS-XATTRs, I wondered what are the strong reasons against?

As I've already told you: you're asking for the addition of a feature which is inadequately defined, and is not documented in any standard.

Quoted 10 lines

Of course someone has to do the work,... but that's not really and argument pro or con NFS-XATTRs, is it?

The security problems with namespaces like trusted. or so can probably be solved quite easy, e.g. simply by not supporting or ignoring/rejecting them.

You've mentioned caching issues,... could you elaborate a bit on that? How is that much different from caching any other file metadata NFS transfers?

The standard metadata such as ctime, mtime, size, .... are all part of an existing NFS caching model called close-to-open. We know how they change when the filesystem data changes.

How do I know when it is safe to cache your checksum xattr? I don't even know what it is, let alone what its relation is to the other filesystem objects.
Let's say client B modifies the file and updates the checksum. When client A opens the file, it will see that the data has changed, but how does it know that it also needs to update the xattr information? Alternatively, let's say that client A reads the file and checksum data after client B has updated the file, but before it updates the checksum. What will cause client A to stop caching the stale checksum once client B has updated it?

Trond

#68 lore raw

Hi Trond,
I am just trying to see if there any path here to get xattr over NFS.

Assuming that there is agreement that xattr are used and needed, and we need to build a better case here but just give alternative solutions doesn't mean that is not needed, almost every thing can be done with an additional DB that associates attributes with files but it is not the best or right way.

So if we had an NFS protocol extension (might not be named attributes) that mapped to and was semantically compatibly to Linux xattr, as Nico wrote, would that be enough to consider adding it to the Linux NFS?

I see the need to show requirement and better interface over the NFS protocol (with no security holes) but not sure if we have another problem with standardizing xattr in Linux?

Thanks, Marc.

From:   "Myklebust, Trond" <[email protected]>
To:     Christoph Anton Mitterer <[email protected]>, 

Cc: Wheeler Ric <[email protected]>, Anand Avati
<[email protected]>, "Dr Fields James Bruce" <[email protected]>, Mailing List Linux NFS <[email protected]>, Dickson Steve <[email protected]>

Date:   10/28/2013 07:28 PM
Subject:        Re: XATTRs in NFS?
Sent by:        [email protected]
Quoted 2 lines · Christoph Anton Mitterer

Trond,... since you ask for motivations pro NFS-XATTRs, I wondered what are the strong reasons against?

As I've already told you: you're asking for the addition of a feature which is inadequately defined, and is not documented in any standard.

Quoted 10 lines

Of course someone has to do the work,... but that's not really and argument pro or con NFS-XATTRs, is it?

The security problems with namespaces like trusted. or so can probably be solved quite easy, e.g. simply by not supporting or ignoring/rejecting them.

You've mentioned caching issues,... could you elaborate a bit on that? How is that much different from caching any other file metadata NFS transfers?

The standard metadata such as ctime, mtime, size, .... are all part of an existing NFS caching model called close-to-open. We know how they change when the filesystem data changes.

How do I know when it is safe to cache your checksum xattr? I don't even know what it is, let alone what its relation is to the other filesystem objects.
Let's say client B modifies the file and updates the checksum. When client A opens the file, it will see that the data has changed, but how does it know that it also needs to update the xattr information? Alternatively, let's say that client A reads the file and checksum data after client B has updated the file, but before it updates the checksum. What will cause client A to stop caching the stale checksum once client B has updated it?

Trond--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#69 lore raw
In reply to Ric Wheeler

Hi,

We are prepared to contribute a draft implementation of -something-, and have planned to do so.

We're currently working on Ganesha support. I have assumed that what we would implement is mapping of from user xattr to current nfsv4 named attributes.

Matt

Quoted 45 lines · ----- "Ric Wheeler
Quoted 1 line · Trond

On Oct 28, 2013, at 12:15 PM, Christoph Anton Mitterer

Quoted 3 lines · <[email protected]> wrote:
Quoted 3 lines · Ric Wheeler
Quoted 1 line

Then you end up with large directories and an extra name per inode

that needs to

Quoted 1 line
Quoted 1 line
Quoted 1 line

be stored and extra lookups for each file when you do a whole file

system crawl.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Certainly not as easy as adding and xattrs with that information

:)

Quoted 3 lines
Quoted 3 lines

And I think there's another reason why it wouldn't work...

Imagine I change my system to encode what should be XATTRs in

hardlink

Quoted 7 lines
Quoted 7 lines

pseudo files...

If I have such pair locally e.g. on my ext4:
/foo/bar/actual/file
/meta/<SHA512 identifier>.2342348324

And now move/copy the file via the network to the archive, I'd have

to

Quoted 1 line
Quoted 1 line

copy both files (which is really annoying), and I'd guess the

inode

Quoted 1 line
Quoted 1 line

coupling would get los (and at least the name wouldn't fit

anymore).

Quoted 5 lines
Quoted 2 lines

So the whole thing is IMHO not even a workaround.

OK. So you're going to do XATTRs for us?

Trond

Now that pNFS is perfect and labeled NFS has made it upstream, I think that
Steve D must be looking for something to keep him busy :)

ric

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 10 lines
Matt Benjamin
The Linux Box
206 South Fifth Ave. Suite 150
Ann Arbor, MI  48104

http://linuxbox.com

tel.  734-761-4689 
fax.  734-769-8938 
cel.  734-216-5309 
#70 lore raw
In reply to Myklebust, Trond
Quoted 1 line · Trond

OK. So you're going to do XATTRs for us?

That's not what I've said ;-) ... neither have I said that you must or should do it.

I asked for the status and mentioned the need of it. You asked me why - so I tried to explain.

Cheers,
Chris.