Re: [Jfs-discussion] [PATCH 27/28] ext4: xattr inode deduplication

2017-05-31 Thread kbuild test robot
Hi Tahsin,

[auto build test ERROR on ext4/dev]
[also build test ERROR on next-20170531]
[cannot apply to v4.12-rc3]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Tahsin-Erdogan/ext4-xattr-in-inode-support/20170531-214310
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
config: powerpc-pcm030_defconfig (attached as .config)
compiler: powerpc-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

>> ERROR: "crc32c" [fs/ext4/ext4.ko] undefined!

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Jfs-discussion mailing list
Jfs-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jfs-discussion


Re: [Jfs-discussion] [PATCH 27/28] ext4: xattr inode deduplication

2017-05-31 Thread kbuild test robot
Hi Tahsin,

[auto build test ERROR on ext4/dev]
[also build test ERROR on next-20170531]
[cannot apply to v4.12-rc3]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Tahsin-Erdogan/ext4-xattr-in-inode-support/20170531-214310
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
config: i386-defconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

   fs/built-in.o: In function `ext4_xattr_inode_get':
>> xattr.c:(.text+0xb8818): undefined reference to `crc32c'
   fs/built-in.o: In function `ext4_xattr_set_entry':
   xattr.c:(.text+0xb9614): undefined reference to `crc32c'

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Jfs-discussion mailing list
Jfs-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jfs-discussion


Re: [Jfs-discussion] [PATCH 27/28] ext4: xattr inode deduplication

2017-05-31 Thread Darrick J. Wong
On Wed, May 31, 2017 at 01:15:16AM -0700, Tahsin Erdogan wrote:
> Ext4 now supports xattr values that are up to 64k in size (vfs limit).
> Large xattr values are stored in external inodes each one holding a
> single value. Once written the data blocks of these inodes are immutable.
> 
> The real world use cases are expected to have a lot of value duplication
> such as inherited acls etc. To reduce data duplication on disk, this patch
> implements a deduplicator that allows sharing of xattr inodes.
> 
> The deduplication is based on an in-memory hash lookup that is a best
> effort sharing scheme. When a xattr inode is read from disk (i.e.
> getxattr() call), its crc32c hash is added to a hash table. Before
> creating a new xattr inode for a value being set, the hash table is
> checked to see if an existing inode holds an identical value. If such an
> inode is found, the ref count on that inode is incremented. On value
> removal the ref count is decremented and if it reaches zero the inode is
> deleted.
> 
> The quota charging for such inodes is manually managed. Every reference
> holder is charged the full size as if there was no sharing happening.
> This is consistent with how xattr blocks are also charged.
> 
> Signed-off-by: Tahsin Erdogan 
> ---
>  fs/ext4/acl.c   |5 +-
>  fs/ext4/ext4.h  |7 +-
>  fs/ext4/inode.c |9 +-
>  fs/ext4/super.c |   22 +-
>  fs/ext4/xattr.c | 1073 
> +++
>  fs/ext4/xattr.h |   17 +-
>  fs/mbcache.c|9 +-
>  7 files changed, 881 insertions(+), 261 deletions(-)
> 
> diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
> index 74f7ac539e00..8db03e5c78bc 100644
> --- a/fs/ext4/acl.c
> +++ b/fs/ext4/acl.c
> @@ -238,7 +238,10 @@ ext4_set_acl(struct inode *inode, struct posix_acl *acl, 
> int type)
>   if (error)
>   return error;
>  retry:
> - credits = ext4_xattr_set_credits(inode, acl_size);
> + error = ext4_xattr_set_credits(inode, acl_size, );
> + if (error)
> + return error;
> +
>   handle = ext4_journal_start(inode, EXT4_HT_XATTR, credits);
>   if (IS_ERR(handle))
>   return PTR_ERR(handle);
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index d79d8d7bee88..79f06290e723 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -1517,6 +1517,7 @@ struct ext4_sb_info {
>   long s_es_nr_inode;
>   struct ext4_es_stats s_es_stats;
>   struct mb_cache *s_mb_cache;
> + struct mb_cache *s_ea_inode_cache;
>   spinlock_t s_es_lock cacheline_aligned_in_smp;
>  
>   /* Ratelimit ext4 messages. */
> @@ -2099,7 +2100,11 @@ static inline struct ext4_inode *ext4_raw_inode(struct 
> ext4_iloc *iloc)
>   return (struct ext4_inode *) (iloc->bh->b_data + iloc->offset);
>  }
>  
> -#define ext4_is_quota_file(inode) IS_NOQUOTA(inode)
> +static inline bool ext4_is_quota_file(struct inode *inode)
> +{
> + return IS_NOQUOTA(inode) &&
> +!(EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL);
> +}
>  
>  /*
>   * This structure is stuffed into the struct file's private_data field
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 4d6936f0d8a4..6f5872197d6c 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -4843,8 +4843,15 @@ struct inode *ext4_iget(struct super_block *sb, 
> unsigned long ino)
>   }
>   brelse(iloc.bh);
>   ext4_set_inode_flags(inode);
> - if (ei->i_flags & EXT4_EA_INODE_FL)
> +
> + if (ei->i_flags & EXT4_EA_INODE_FL) {
>   ext4_xattr_inode_set_class(inode);
> +
> + inode_lock(inode);
> + inode->i_flags |= S_NOQUOTA;
> + inode_unlock(inode);
> + }
> +
>   unlock_new_inode(inode);
>   return inode;
>  
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index b02a23ec92ca..7d2b692d52ea 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -927,6 +927,10 @@ static void ext4_put_super(struct super_block *sb)
>   invalidate_bdev(sbi->journal_bdev);
>   ext4_blkdev_remove(sbi);
>   }
> + if (sbi->s_ea_inode_cache) {
> + ext4_xattr_destroy_cache(sbi->s_ea_inode_cache);
> + sbi->s_ea_inode_cache = NULL;
> + }
>   if (sbi->s_mb_cache) {
>   ext4_xattr_destroy_cache(sbi->s_mb_cache);
>   sbi->s_mb_cache = NULL;
> @@ -1178,7 +1182,10 @@ static int ext4_set_context(struct inode *inode, const 
> void *ctx, size_t len,
>   if (res)
>   return res;
>  retry:
> - credits = ext4_xattr_set_credits(inode, len);
> + res = ext4_xattr_set_credits(inode, len, );
> + if (res)
> + return res;
> +
>   handle = ext4_journal_start(inode, EXT4_HT_MISC, credits);
>   if (IS_ERR(handle))
>   return PTR_ERR(handle);
> @@ -4067,6 +4074,15 @@ static int ext4_fill_super(struct super_block *sb, 
> void *data, int silent)
>   goto failed_mount_wq;
>   }
>  
> + if