All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manish Katiyar <mkatiyar@gmail.com>
To: Jan Kara <jack@suse.cz>, ext4 <linux-ext4@vger.kernel.org>
Cc: mkatiyar@gmail.com
Subject: [PATCH 1/3] jbd2 : Make jbd2 transaction handle allocation to return errors and handle them gracefully.
Date: Sat, 22 Jan 2011 19:32:44 -0800	[thread overview]
Message-ID: <AANLkTi=o-rcsbY1gOExGyWdQ41m7KWpJ7=UzX4306m=t@mail.gmail.com> (raw)

 Hi Jan,

This is the follow up from https://lkml.org/lkml/2011/1/17/154
Following patches make jbd2 to use GFP_KERNEL for transaction
allocation if the caller can handle the errors. Following is the list
of functions that I updated to pass the new flag. Also below is the
list of functions which still have the old behavior and pass the old
flags (either because they can't deal with errors, or I wasn't too
sure so I did conservatively). Appreciate your feedback. The other
callers of jbd2_journal_start() are from ocfs2, they still pass the
old flag.

OK to handle errors.
-------------------------
ext4_init_inode_table
ext4_group_add
setup_new_group_blocks
update_backups
ext4_group_extend
ext4_release_dquot
ext4_acquire_dquot
ext4_acl_chmod
ext4_xattr_set_acl
ext4_xattr_set
et4_ioctl - For setting EXT4_IOC_SETVERSION_OLD
ext4_ext_migrate
ext4_ext_migrate
ext4_rmdir
ext4_unlink
ext4_symlink
ext4_link
ext4_rename
ext4_mkdir
ext4_mknod
ext4_fallocate
ext4_create
move_extent_per_page
ext4_change_inode_journal_flag
ext4_setattr
ext4_setattr

NOT ok
-------------------
ext4_write_dquot
ext4_ioctl - Not ok for EXT4_EOFBLOCKS_FL
ext4_ext_remove_space
ext4_ext_truncate
ext4_write_info
ext4_convert_unwritten_extents
ext4_ind_direct_IO
ext4_ind_direct_IO
ext4_dirty_inode
ext4_setattr
ext4_evict_inode
_ext4_get_block
ext4_write_begin
__ext4_journalled_writepage
ext4_da_writepages
ext4_da_write_begin
start_transaction

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 faad2bd..0fa4c86 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -346,9 +346,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);

@@ -476,9 +477,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);

@@ -1429,7 +1431,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 27e79c2..b24342f 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1081,9 +1081,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.6.0.4




-- 
Thanks -
Manish
==================================
[$\*.^ -- I miss being one of them
==================================

             reply	other threads:[~2011-01-23  3:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-23  3:32 Manish Katiyar [this message]
2011-01-23  5:40 ` [PATCH 1/3] jbd2 : Make jbd2 transaction handle allocation to return errors and handle them gracefully Ted Ts'o
2011-01-23  5:53   ` Manish Katiyar
2011-01-23  6:29   ` Joel Becker
2011-01-24 13:31     ` Jan Kara
2011-01-24 17:20       ` Joel Becker
2011-01-25 11:40         ` Jan Kara
2011-01-25  0:06       ` Andreas Dilger
2011-01-25 11:46         ` Jan Kara
2011-01-30  5:40           ` Manish Katiyar
2011-02-04 15:53             ` Jan Kara
2011-02-04 22:44               ` Manish Katiyar
2011-04-25  0:06               ` Manish Katiyar
2011-01-25  6:47       ` Andreas Dilger

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='AANLkTi=o-rcsbY1gOExGyWdQ41m7KWpJ7=UzX4306m=t@mail.gmail.com' \
    --to=mkatiyar@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.