From: Jan Kara <jack@suse.cz>
To: Manish Katiyar <mkatiyar@gmail.com>
Cc: ext4 <linux-ext4@vger.kernel.org>, Jan Kara <jack@suse.cz>,
Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH 1/5] jbd2: Pass extra bool parameter in journal routines to specify if its ok to fail the journal transaction allocation.
Date: Wed, 11 May 2011 17:54:47 +0200 [thread overview]
Message-ID: <20110511155447.GH5057@quack.suse.cz> (raw)
In-Reply-To: <BANLkTinNUxt_Bj0JErLVDbh=73JHzzS9=w@mail.gmail.com>
Hi,
sorry I got to your patches with a delay. One general note - please do
not attach patches. It is enough to have them in the email...
On Sun 24-04-11 17:10:41, Manish Katiyar wrote:
> Pass extra bool parameter in journal routines to specify if its ok to
> fail the journal transaction allocation. If 'true' is passed
> transaction allocation is done through GFP_KERNEL and ENOMEM is
> returned else GFP_NOFS is used.
Please, do not mix error handling with gfp masks. Instead just rename
jbd2__journal_start() to jbd2_journal_start() and change gfp_mask parameter
to "bool errok". Use GFP_NOFS gfp mask for start_this_handle(). Noone
uses jbd2__journal_start() and it was mainly added to make it possible to
specify that start_this_handle() can fail but IMHO it's a hack.
Also your patch series should be bisectable - that means it must compile
and run after any of the patches. So you cannot really change
jbd2_journal_start() prototype without changing all the filesystems using
it. In this case, just include in this patch a simple change for ext4 and
ocfs2 to pass 'false' in the additional argument.
Honza
> Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
> ---
> fs/jbd2/transaction.c | 12 +++++++-----
> include/linux/jbd2.h | 4 ++--
> 2 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
> index 05fa77a..b02d6a4 100644
> --- a/fs/jbd2/transaction.c
> +++ b/fs/jbd2/transaction.c
> @@ -349,9 +349,10 @@ handle_t *jbd2__journal_start(journal_t *journal,
> int nblocks, int gfp_mask)
> EXPORT_SYMBOL(jbd2__journal_start);
>
>
> -handle_t *jbd2_journal_start(journal_t *journal, int nblocks)
> +handle_t *jbd2_journal_start(journal_t *journal, int nblocks, bool errok)
> {
> - return jbd2__journal_start(journal, nblocks, GFP_NOFS);
> + return jbd2__journal_start(journal, nblocks,
> + errok ? GFP_KERNEL : GFP_NOFS);
> }
> EXPORT_SYMBOL(jbd2_journal_start);
>
> @@ -483,9 +484,10 @@ int jbd2__journal_restart(handle_t *handle, int
> nblocks, int gfp_mask)
> EXPORT_SYMBOL(jbd2__journal_restart);
>
>
> -int jbd2_journal_restart(handle_t *handle, int nblocks)
> +int jbd2_journal_restart(handle_t *handle, int nblocks, bool errok)
> {
> - return jbd2__journal_restart(handle, nblocks, GFP_NOFS);
> + return jbd2__journal_restart(handle, nblocks,
> + errok ? GFP_KERNEL : GFP_NOFS);
> }
> EXPORT_SYMBOL(jbd2_journal_restart);
>
> @@ -1436,7 +1438,7 @@ int jbd2_journal_force_commit(journal_t *journal)
> handle_t *handle;
> int ret;
>
> - handle = jbd2_journal_start(journal, 1);
> + handle = jbd2_journal_start(journal, 1, false);
> if (IS_ERR(handle)) {
> ret = PTR_ERR(handle);
> } else {
> diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> index a32dcae..a64aced 100644
> --- a/include/linux/jbd2.h
> +++ b/include/linux/jbd2.h
> @@ -1103,9 +1103,9 @@ static inline handle_t *journal_current_handle(void)
> * Register buffer modifications against the current transaction.
> */
>
> -extern handle_t *jbd2_journal_start(journal_t *, int nblocks);
> +extern handle_t *jbd2_journal_start(journal_t *, int nblocks, bool errok);
> extern handle_t *jbd2__journal_start(journal_t *, int nblocks, int gfp_mask);
> -extern int jbd2_journal_restart(handle_t *, int nblocks);
> +extern int jbd2_journal_restart(handle_t *, int nblocks, bool errok);
> extern int jbd2__journal_restart(handle_t *, int nblocks, int gfp_mask);
> extern int jbd2_journal_extend (handle_t *, int nblocks);
> extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *);
> --
> 1.7.1
>
>
> --
> Thanks -
> Manish
> From c9edbd8d1da02ada2615acec3e3083b4669f6d9e Mon Sep 17 00:00:00 2001
> From: Manish Katiyar <mkatiyar@gmail.com>
> Date: Sun, 24 Apr 2011 00:14:54 -0700
> Subject: [PATCH 1/5] Pass extra bool parameter in journal routines to specify if its ok to fail the journal transaction allocation. If 'true' is passed transaction allocation is done through GFP_KERNEL else GFP_NOFS is used.
>
> Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
> ---
> fs/jbd2/transaction.c | 12 +++++++-----
> include/linux/jbd2.h | 4 ++--
> 2 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
> index 05fa77a..b02d6a4 100644
> --- a/fs/jbd2/transaction.c
> +++ b/fs/jbd2/transaction.c
> @@ -349,9 +349,10 @@ handle_t *jbd2__journal_start(journal_t *journal, int nblocks, int gfp_mask)
> EXPORT_SYMBOL(jbd2__journal_start);
>
>
> -handle_t *jbd2_journal_start(journal_t *journal, int nblocks)
> +handle_t *jbd2_journal_start(journal_t *journal, int nblocks, bool errok)
> {
> - return jbd2__journal_start(journal, nblocks, GFP_NOFS);
> + return jbd2__journal_start(journal, nblocks,
> + errok ? GFP_KERNEL : GFP_NOFS);
> }
> EXPORT_SYMBOL(jbd2_journal_start);
>
> @@ -483,9 +484,10 @@ int jbd2__journal_restart(handle_t *handle, int nblocks, int gfp_mask)
> EXPORT_SYMBOL(jbd2__journal_restart);
>
>
> -int jbd2_journal_restart(handle_t *handle, int nblocks)
> +int jbd2_journal_restart(handle_t *handle, int nblocks, bool errok)
> {
> - return jbd2__journal_restart(handle, nblocks, GFP_NOFS);
> + return jbd2__journal_restart(handle, nblocks,
> + errok ? GFP_KERNEL : GFP_NOFS);
> }
> EXPORT_SYMBOL(jbd2_journal_restart);
>
> @@ -1436,7 +1438,7 @@ int jbd2_journal_force_commit(journal_t *journal)
> handle_t *handle;
> int ret;
>
> - handle = jbd2_journal_start(journal, 1);
> + handle = jbd2_journal_start(journal, 1, false);
> if (IS_ERR(handle)) {
> ret = PTR_ERR(handle);
> } else {
> diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> index a32dcae..a64aced 100644
> --- a/include/linux/jbd2.h
> +++ b/include/linux/jbd2.h
> @@ -1103,9 +1103,9 @@ static inline handle_t *journal_current_handle(void)
> * Register buffer modifications against the current transaction.
> */
>
> -extern handle_t *jbd2_journal_start(journal_t *, int nblocks);
> +extern handle_t *jbd2_journal_start(journal_t *, int nblocks, bool errok);
> extern handle_t *jbd2__journal_start(journal_t *, int nblocks, int gfp_mask);
> -extern int jbd2_journal_restart(handle_t *, int nblocks);
> +extern int jbd2_journal_restart(handle_t *, int nblocks, bool errok);
> extern int jbd2__journal_restart(handle_t *, int nblocks, int gfp_mask);
> extern int jbd2_journal_extend (handle_t *, int nblocks);
> extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *);
> --
> 1.7.1
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2011-05-11 15:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-25 0:10 [PATCH 1/5] jbd2: Pass extra bool parameter in journal routines to specify if its ok to fail the journal transaction allocation Manish Katiyar
2011-05-11 15:54 ` Jan Kara [this message]
2011-05-13 6:37 ` Manish Katiyar
2011-05-16 15:51 ` Jan Kara
2011-05-18 6:38 ` Manish Katiyar
2011-05-18 8:09 ` Jan Kara
2011-05-18 8:36 ` Manish Katiyar
2011-05-18 12:44 ` Jan Kara
2011-05-19 4:48 ` Manish Katiyar
2011-05-24 22:56 ` Ted Ts'o
2011-05-25 0:14 ` Manish Katiyar
2011-05-25 0:25 ` Ted Ts'o
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=20110511155447.GH5057@quack.suse.cz \
--to=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=mkatiyar@gmail.com \
--cc=tytso@mit.edu \
/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).