New file attribute for integrity

Alex Elsayed eternaleye at gmail.com
Mon Jul 1 14:07:51 MDT 2013


Steve French wrote:

> At the SMB3 test events over the last two weeks, we found out about a
> new file attribute which Windows servers can return
> "FILE_ATTRIBUTE_INTEGRITY_STREAM" (it can also be returned as an
> fsinfo, volume, property - not just as a file attribute).
> 
> The flag is set by the server in responses to query information about
> a file when the underlying file system does checksumming of the data
> and metadata for the file (similarly if the volume always checksums
> data and metadata this flag would be enabled on the fsinfo response).
>  Apparently REFS when run in certain configurations (mirrored drives?)
> or when formatted to require metadata/data integrity checksumming can
> provide these extra guarantees.
> 
> btrfs seems to support both metadata and data checksumming by default
> and presumably if "check_int" is compiled in and enabled this is the
> equivalent.  What should Samba server use to check if data and
> metadata integrity checksumming is enabled in btrfs?  Are there any
> other in-kernel filesystems that support metadata/data integrity
> checksumming and how would Samba server detect them.
> 
> SMB3 allows you (the app running on the client) to individually ask
> the server's filesystem to enable or disable (metadata and data)
> integrity checking on a directory or file - I don't know of any
> equivalent on btrfs or any Linux file system.  Is there an example of
> a Linux file system that lets you set this on per file or directory
> basis?
> 

If I'm remembering correctly, btrfs does permit setting the 'nodatasum' 
option per-file, but doesn't expose that to userspace at this time. It 
*does* expose nodatacow (which implies nodatasum) via chattr +C (capital c), 
but that has some limitations.

>From chattr man page: For btrfs, the 'C' flag should be set on new or empty 
files. If it is set on a file which already has data blocks, it is undefined 
when the blocks assigned to the file will be fully stable. If the 'C' flag 
is set on a directory, it will have no effect on the directory, but new 
files created in that directory will have the No_COW attribute. 



More information about the samba-technical mailing list