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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120417095830.GE7198@quack.suse.cz>
Date:	Tue, 17 Apr 2012 11:58:30 +0200
From:	Jan Kara <jack@...e.cz>
To:	Shaohua Li <shli@...nel.org>
Cc:	linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	tytso@....edu
Subject: Re: [RFC]jbd2: use GFP_NOFS for blkdev_issue_flush

On Fri 13-04-12 10:27:35, Shaohua Li wrote:
> 
> flush request is issued in transaction commit code path, so looks using
> GFP_KERNEL to allocate memory for flush request bio falls into the classic
> deadlock issue.  I saw btrfs and dm get it right, but ext4, xfs and md are
> using GFP_KERNEL, which makes me confused. Hoping filesystem developers
> clarify.
> 
> Signed-off-by: Shaohua Li <shli@...ionio.com>
  Yeah, ext4 (jbd2) should use GFP_NOFS since we are in a kjournald and
reclaim could possibly need to start a transaction thus blocking on
kjournald. So you have my:
  Reviewed-by: Jan Kara <jack@...e.cz>

								Honza
> ---
>  fs/jbd2/commit.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Index: linux/fs/jbd2/commit.c
> ===================================================================
> --- linux.orig/fs/jbd2/commit.c	2012-04-13 09:57:51.785506925 +0800
> +++ linux/fs/jbd2/commit.c	2012-04-13 09:58:29.585498773 +0800
> @@ -723,7 +723,7 @@ start_journal_io:
>  	if (commit_transaction->t_need_data_flush &&
>  	    (journal->j_fs_dev != journal->j_dev) &&
>  	    (journal->j_flags & JBD2_BARRIER))
> -		blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
> +		blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS, NULL);
> 
>  	/* Done it all: now write the commit record asynchronously. */
>  	if (JBD2_HAS_INCOMPAT_FEATURE(journal,
> @@ -859,7 +859,7 @@ wait_for_iobuf:
>  	if (JBD2_HAS_INCOMPAT_FEATURE(journal,
>  				      JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) &&
>  	    journal->j_flags & JBD2_BARRIER) {
> -		blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL);
> +		blkdev_issue_flush(journal->j_dev, GFP_NOFS, NULL);
>  	}
> 
>  	if (err)
> --
> 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
-- 
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