Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1668888

Re: [PATCH 30/31] ext4: eliminate xattr entry e_hash recalculation for removes

From Jan Kara <jack@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH 30/31] ext4: eliminate xattr entry e_hash recalculation for removes
Date 2017-06-19 10:20 +0200
Message-ID <tU04F-7z-3@gated-at.bofh.it> (permalink)
References <tSkhb-85J-9@gated-at.bofh.it> <tSz6x-C2-1@gated-at.bofh.it> <tTblv-ho-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri 16-06-17 19:04:44, Tahsin Erdogan wrote:
> On Thu, Jun 15, 2017 at 2:10 AM, Jan Kara <jack@suse.cz> wrote:
> > I agree with moving ext4_xattr_rehash_entry() out of ext4_xattr_rehash().
> > However how about just keeping ext4_xattr_rehash() in
> > ext4_xattr_block_set() (so that you don't have to pass aditional argument
> > to ext4_xattr_set_entry()) and calling ext4_xattr_rehash_entry() when
> > i->value != NULL? That would seem easier and cleaner as well...
> 
> The is_block parameter is also used to decide whether block reserve
> check should be performed:
> 
> @@ -1500,8 +1502,8 @@ static int ext4_xattr_set_entry(struct ext4_xattr_info *i,
>                  * attribute block so that a long value does not occupy the
>                  * whole space and prevent futher entries being added.
>                  */
> -               if (ext4_has_feature_ea_inode(inode->i_sb) && new_size &&
> -                   (s->end - s->base) == i_blocksize(inode) &&
> +               if (ext4_has_feature_ea_inode(inode->i_sb) &&
> +                   new_size && is_block &&
>                     (min_offs + old_size - new_size) <
>                                         EXT4_XATTR_BLOCK_RESERVE(inode)) {
>                         ret = -ENOSPC;
> 
> Because of that, I think moving ext4_xattr_rehash to caller makes it
> bit more complicated. Let me know if you disagree.

What I dislike is the leakage of information about particular type of
storage into ext4_xattr_set_entry(). However I agree that it would be
cumbersome to handle this reservation check differently so ok.

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 30/31] ext4: eliminate xattr entry e_hash recalculation for removes Tahsin Erdogan <tahsin@google.com> - 2017-06-14 19:30 +0200
  Re: [PATCH 30/31] ext4: eliminate xattr entry e_hash recalculation  for removes Jan Kara <jack@suse.cz> - 2017-06-15 11:20 +0200
    Re: [PATCH 30/31] ext4: eliminate xattr entry e_hash recalculation  for removes Tahsin Erdogan <tahsin@google.com> - 2017-06-17 04:10 +0200
      Re: [PATCH 30/31] ext4: eliminate xattr entry e_hash recalculation  for removes Jan Kara <jack@suse.cz> - 2017-06-19 10:20 +0200

csiph-web