Re: [PATCH 2/3] jbd2 : Fix journal start by passing a parameter to specify if the caller can deal with ENOMEM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> Acked-by: Jan Kara <jack@xxxxxxx>
...
> @@ -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@xxxxxxx>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux