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]
Date:	Wed, 25 May 2011 09:44:57 +0200
From:	Jan Kara <jack@...e.cz>
To:	Manish Katiyar <mkatiyar@...il.com>
Cc:	tytso@....edu, jack@...e.cz, linux-ext4@...r.kernel.org
Subject: Re: [PATCH 2/3] jbd2 : Fix journal start by passing a parameter to
 specify if the caller can deal with ENOMEM

On Wed 25-05-11 00:26:16, Manish Katiyar wrote:
> Pass extra bool parameter in journal routines to specify if its ok to
> fail in the journal start. Passing true means caller is
> ok with journal start failures and can handle ENOMEM. Update ocfs2 and ext4
> routines to pass false for the updated journal interface by default to
> retain the existing behavior.
> 
> Signed-off-by: Manish Katiyar <mkatiyar@...il.com>
> Acked-by: Jan Kara <jack@...e.cz>
...
> @@ -318,7 +320,7 @@ static handle_t *new_handle(int nblocks)
>   *
>   * Return a pointer to a newly allocated handle, or NULL on failure
>   */
> -handle_t *jbd2__journal_start(journal_t *journal, int nblocks, int gfp_mask)
> +handle_t *jbd2_journal_start(journal_t *journal, int nblocks, bool errok)
>  {
>  	handle_t *handle = journal_current_handle();
>  	int err;
> @@ -338,7 +340,7 @@ handle_t *jbd2__journal_start(journal_t *journal, int nblocks, int gfp_mask)
> 
>  	current->journal_info = handle;
> 
> -	err = start_this_handle(journal, handle, gfp_mask);
> +	err = start_this_handle(journal, handle, GFP_NOFS);
>  	if (err < 0) {
>  		jbd2_free_handle(handle);
>  		current->journal_info = NULL;
  This patch is OK as such but as I wrote in a reply to a later patch in
the series, you also need to pass 'errok' to start_this_handle() instead of
gfp_mask as well. Then in start_this_handle() you can use 'errok' to decide
whether we should retry the allocation or not instead of gfp_mask. And just
call kzalloc in start_this_handle() with GFP_NOFS... Thanks.

								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