lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 2 Feb 2010 23:02:01 +0100
From:	Jan Kara <jack@...e.cz>
To:	丁定华 <dingdinghua85@...il.com>
Cc:	Jan Kara <jack@...e.cz>, linux-ext4@...r.kernel.org
Subject: Re: Should we discard jbddirty bit if BH_Freed is set?

> From eb6567de576ac4a9337c3971a2d0549af64e15f0 Mon Sep 17 00:00:00 2001
> From: dingdinghua <dingdinghua@...hpc.ac.cn>
> Date: Sat, 30 Jan 2010 14:23:28 +0800
> Subject: [PATCH] Jbd2: delay discarding buffers in journal_unmap_buffer
> 
> We should delay discarding buffers until we know that "add to orphan"
> operation has definitely been committed, otherwise the log space of
> committing transation may be freed and reused before truncate get
> committed, updates may get lost if crash happens.
  Thanks for the patch. For us to be able to merge the patch, we need a
Signed-off-by signature from you. Please add it in the next round of
submission.

> diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
> index 1bc74b6..c5d1c7c 100644
> --- a/fs/jbd2/commit.c
> +++ b/fs/jbd2/commit.c
> @@ -936,8 +936,10 @@ restart_loop:
>  		 * behind for writeback and gets reallocated for another
>  		 * use in a different page. */
>  		if (buffer_freed(bh)) {
> -			clear_buffer_freed(bh);
> -			clear_buffer_jbddirty(bh);
> +			if (!jh->b_next_transaction) {
> +				clear_buffer_freed(bh);
> +				clear_buffer_jbddirty(bh);
> +			}
>  		}
  When can merge the 'if' here. Also the comment above this code
needs updating after your change.

>  		if (buffer_jbddirty(bh)) {
> diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
> index a051270..0d019f1 100644
> --- a/fs/jbd2/transaction.c
> +++ b/fs/jbd2/transaction.c
> @@ -1788,11 +1788,8 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh)
>  		 * running transaction if that is set, but nothing
>  		 * else. */
>  		set_buffer_freed(bh);
> -		if (jh->b_next_transaction) {
> -			J_ASSERT(jh->b_next_transaction ==
> -					journal->j_running_transaction);
> -			jh->b_next_transaction = NULL;
> -		}
> +		if (journal->j_running_transaction && buffer_jbddirty(bh))
> +			jh->b_next_transaction = journal->j_running_transaction;
  Also here you have to update the comment above set_buffer_freed to match
the new reality.
  Otherwise I'm fine with the patch.

								Honza
-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ