linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: miaoxie@huawei.com, linux-ext4@vger.kernel.org
Subject: Re: [bug report] ext4, project: expand inode extra size if possible
Date: Fri, 13 Dec 2019 12:32:37 +0100	[thread overview]
Message-ID: <20191213113237.GF15474@quack2.suse.cz> (raw)
In-Reply-To: <20191202094103.rgqihwzoxxy676fj@kili.mountain>

On Mon 02-12-19 12:41:04, Dan Carpenter wrote:
> Hello Miao Xie,
> 
> The patch c03b45b853f5: "ext4, project: expand inode extra size if
> possible" from Aug 6, 2017, leads to the following static checker
> warning:
> 
>     fs/ext4/inode.c:5708 ext4_expand_extra_isize()
>     warn: inconsistent returns 'EXT4_I(inode)->xattr_sem'.
>       Locked on  : 5708
>       Unlocked on: 5708
> 
> fs/ext4/inode.c
>   5681          handle = ext4_journal_start(inode, EXT4_HT_INODE,
>   5682                                      EXT4_DATA_TRANS_BLOCKS(inode->i_sb));
>   5683          if (IS_ERR(handle)) {
>   5684                  error = PTR_ERR(handle);
>   5685                  brelse(iloc->bh);
>   5686                  return error;
>   5687          }
>   5688  
>   5689          ext4_write_lock_xattr(inode, &no_expand);
>   5690  
>   5691          BUFFER_TRACE(iloc->bh, "get_write_access");
>   5692          error = ext4_journal_get_write_access(handle, iloc->bh);
>   5693          if (error) {
>   5694                  brelse(iloc->bh);
>   5695                  goto out_stop;
> 
> Shouldn't this goto the ext4_write_unlock_xattr()?

Yes, it should AFAICT. Thanks for spotting this. Care to send a patch?

								Honza

> 
>   5696          }
>   5697  
>   5698          error = __ext4_expand_extra_isize(inode, new_extra_isize, iloc,
>   5699                                            handle, &no_expand);
>   5700  
>   5701          rc = ext4_mark_iloc_dirty(handle, inode, iloc);
>   5702          if (!error)
>   5703                  error = rc;
>   5704  
>   5705          ext4_write_unlock_xattr(inode, &no_expand);
>   5706  out_stop:
>   5707          ext4_journal_stop(handle);
>   5708          return error;
>   5709  }
> 
> 
> regards,
> dan carpenter
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2019-12-13 20:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-02  9:41 [bug report] ext4, project: expand inode extra size if possible Dan Carpenter
2019-12-13 11:32 ` Jan Kara [this message]
2019-12-13 18:50   ` [PATCH] ext4: unlock on error in ext4_expand_extra_isize() Dan Carpenter
2019-12-14 22:32     ` Theodore Y. Ts'o
2019-12-16  9:22     ` Miao Xie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191213113237.GF15474@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=miaoxie@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).