diff options
author | Justus Winter <justus@gnupg.org> | 2016-10-03 19:23:55 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-01-06 20:36:09 +0100 |
commit | 4818346b39b5a58962d1676ea0bb3a0b954c1fed (patch) | |
tree | 3be9303a7822beb42429ed67c3eacfcf7337e7e6 /ext2fs/inode.c | |
parent | c8dac952e7ed2a761da2b061a339d97092e55c01 (diff) | |
download | hurd-4818346b39b5a58962d1676ea0bb3a0b954c1fed.tar.gz hurd-4818346b39b5a58962d1676ea0bb3a0b954c1fed.tar.bz2 hurd-4818346b39b5a58962d1676ea0bb3a0b954c1fed.zip |
ext2fs: Require users to opt-in for xattr-based translator records.
* ext2fs/ext2fs.c (use_xattr_translator_records): New variable.
(X_XATTR_TRANSLATOR_RECORDS): New macro.
(options): New option '--x-xattr-translator-records'.
(parse_opt): Handle new option.
* ext2fs/ext2fs.h (use_xattr_translator_records): New declaration.
* ext2fs/inode.c (diskfs_set_translator): Use new variable.
(diskfs_get_translator): Likewise.
Diffstat (limited to 'ext2fs/inode.c')
-rw-r--r-- | ext2fs/inode.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext2fs/inode.c b/ext2fs/inode.c index 5109953f..58edb501 100644 --- a/ext2fs/inode.c +++ b/ext2fs/inode.c @@ -562,7 +562,8 @@ diskfs_set_translator (struct node *np, const char *name, unsigned namelen, /* If xattr is supported for this filesystem, use xattr to store translator record, otherwise, use legacy translator record */ - if (EXT2_HAS_COMPAT_FEATURE (sblock, EXT2_FEATURE_COMPAT_EXT_ATTR)) + if (EXT2_HAS_COMPAT_FEATURE (sblock, EXT2_FEATURE_COMPAT_EXT_ATTR) + && use_xattr_translator_records) { daddr_t blkno; struct ext2_inode *di; @@ -714,7 +715,8 @@ diskfs_get_translator (struct node *np, char **namep, unsigned *namelen) if (blkno) { /* If xattr is no supported by this filesystem, don't report a warning */ - if (EXT2_HAS_COMPAT_FEATURE (sblock, EXT2_FEATURE_COMPAT_EXT_ATTR)) + if (EXT2_HAS_COMPAT_FEATURE (sblock, EXT2_FEATURE_COMPAT_EXT_ATTR) + && use_xattr_translator_records) ext2_warning ("This is an old translator record, please update it"); transloc = disk_cache_block_ref (blkno); |