From: Eric Sandeen <sandeen@redhat.com>
To: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
Cc: tytso@mit.edu, adilger@sun.com, linux-ext4@vger.kernel.org
Subject: Re: [PATCH][BUG] ext4: do not execute ext4_std_error with EFBIG at ext4_setattr
Date: Mon, 28 Jun 2010 09:58:53 -0500 [thread overview]
Message-ID: <4C28B8AD.6040001@redhat.com> (raw)
In-Reply-To: <20100628114256.0c633779.toshi.okajima@jp.fujitsu.com>
Toshiyuki Okajima wrote:
> From: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
>
> You know, do_truncate() can call ext4_setattr() (via notify_change()).
> And, ext4_setattr() can return with -EFBIG if the argument(length) of
> do_truncate() is more than sbi->s_bitmap_maxbytes. At that time,
> it also calls ext4_std_error() with -EFBIG.
>
> Besides, a panic happens when ext4_setattr() returns with -EFBIG
> after we mount an ext4 filesystem with errors=panic.
...
> This changes prevent this problem from happening.
Whoops, that one was my fault; thanks for catching it.
I might just "return error" at that spot, but this works fine too.
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> Signed-off-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
> ---
> fs/ext4/inode.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 42272d6..e87bb45 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -5485,7 +5485,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
>
> if (attr->ia_size > sbi->s_bitmap_maxbytes) {
> error = -EFBIG;
> - goto err_out;
> + goto err_out2;
> }
> }
> }
> @@ -5544,6 +5544,7 @@ err_out:
> ext4_std_error(inode->i_sb, error);
> if (!error)
> error = rc;
> +err_out2:
> return error;
> }
>
next prev parent reply other threads:[~2010-06-28 14:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-28 2:42 [PATCH][BUG] ext4: do not execute ext4_std_error with EFBIG at ext4_setattr Toshiyuki Okajima
2010-06-28 14:58 ` Eric Sandeen [this message]
2010-07-27 1:09 ` Ted Ts'o
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=4C28B8AD.6040001@redhat.com \
--to=sandeen@redhat.com \
--cc=adilger@sun.com \
--cc=linux-ext4@vger.kernel.org \
--cc=toshi.okajima@jp.fujitsu.com \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.