linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Namhyung Kim <namhyung@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] ext3: Add journal error check into ext3_delete_entry()
Date: Mon, 22 Nov 2010 18:55:41 +0100	[thread overview]
Message-ID: <20101122175541.GD5012@quack.suse.cz> (raw)
In-Reply-To: <1290151716-4041-1-git-send-email-namhyung@gmail.com>

On Fri 19-11-10 16:28:35, Namhyung Kim wrote:
> Check return value of ext3_journal_get_write_access() and
> ext3_journal_dirty_metadata().
  Thanks, merged.

								Honza

> 
> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
> ---
>  fs/ext3/namei.c |   14 ++++++++++++--
>  1 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
> index 03fccc5..672cea1 100644
> --- a/fs/ext3/namei.c
> +++ b/fs/ext3/namei.c
> @@ -1644,8 +1644,13 @@ static int ext3_delete_entry (handle_t *handle,
>  		if (!ext3_check_dir_entry("ext3_delete_entry", dir, de, bh, i))
>  			return -EIO;
>  		if (de == de_del)  {
> +			int err;
> +
>  			BUFFER_TRACE(bh, "get_write_access");
> -			ext3_journal_get_write_access(handle, bh);
> +			err = ext3_journal_get_write_access(handle, bh);
> +			if (err)
> +				goto journal_error;
> +
>  			if (pde)
>  				pde->rec_len = ext3_rec_len_to_disk(
>  					ext3_rec_len_from_disk(pde->rec_len) +
> @@ -1654,7 +1659,12 @@ static int ext3_delete_entry (handle_t *handle,
>  				de->inode = 0;
>  			dir->i_version++;
>  			BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
> -			ext3_journal_dirty_metadata(handle, bh);
> +			err = ext3_journal_dirty_metadata(handle, bh);
> +			if (err) {
> +journal_error:
> +				ext3_std_error(dir->i_sb, err);
> +				return err;
> +			}
>  			return 0;
>  		}
>  		i += ext3_rec_len_from_disk(de->rec_len);
> -- 
> 1.7.0.4
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

      parent reply	other threads:[~2010-11-22 17:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-19  7:28 [PATCH 1/2] ext3: Add journal error check into ext3_delete_entry() Namhyung Kim
2010-11-19  7:28 ` [PATCH 2/2] ext3: Add journal error check into ext3_rename() Namhyung Kim
2010-11-22 18:05   ` Jan Kara
2010-11-23  3:37     ` Namhyung Kim
2010-11-22 17:55 ` Jan Kara [this message]

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=20101122175541.GD5012@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=adilger.kernel@dilger.ca \
    --cc=akpm@linux-foundation.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@gmail.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).