From: Manish Katiyar Subject: [PATCH 5/5] ext4 : Update ext4 routines to call ext4_journal_start_tryhard() if the transaction allocation isn't supposed to fail. Date: Sun, 24 Apr 2011 17:19:38 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=0016e6538572eb948904a1b32aba Cc: Manish Katiyar , Jan Kara , "Theodore Ts'o" To: ext4 Return-path: Received: from mail-qw0-f46.google.com ([209.85.216.46]:54909 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757834Ab1DYAT6 (ORCPT ); Sun, 24 Apr 2011 20:19:58 -0400 Received: by qwk3 with SMTP id 3so798939qwk.19 for ; Sun, 24 Apr 2011 17:19:58 -0700 (PDT) Sender: linux-ext4-owner@vger.kernel.org List-ID: --0016e6538572eb948904a1b32aba Content-Type: text/plain; charset=ISO-8859-1 Update ext4 routines to call ext4_journal_start_tryhard() if the transaction allocation isn't supposed to fail. When ext4_journal_start_tryhard is called, allocation is done with GFP_NOFS flags instead of GFP_KERNEL. Signed-off-by: Manish Katiyar --- fs/ext4/extents.c | 6 +++--- fs/ext4/ialloc.c | 2 +- fs/ext4/inode.c | 27 ++++++++++++++++----------- fs/ext4/super.c | 8 ++++---- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 4890d6f..bf0bb9c 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -2337,7 +2337,7 @@ static int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start) ext_debug("truncate since %u\n", start); /* probably first extent we're gonna free will be last in block */ - handle = ext4_journal_start(inode, depth + 1); + handle = ext4_journal_start_tryhard(inode, depth + 1); if (IS_ERR(handle)) return PTR_ERR(handle); @@ -3550,7 +3550,7 @@ void ext4_ext_truncate(struct inode *inode) * probably first extent we're gonna free will be last in block */ err = ext4_writepage_trans_blocks(inode); - handle = ext4_journal_start(inode, err); + handle = ext4_journal_start_tryhard(inode, err); if (IS_ERR(handle)) return; @@ -3762,7 +3762,7 @@ int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset, while (ret >= 0 && ret < max_blocks) { map.m_lblk += ret; map.m_len = (max_blocks -= ret); - handle = ext4_journal_start(inode, credits); + handle = ext4_journal_start_tryhard(inode, credits); if (IS_ERR(handle)) { ret = PTR_ERR(handle); break; diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 21bb2f6..40902f3 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -1263,7 +1263,7 @@ extern int ext4_init_inode_table(struct super_block *sb, ext4_group_t group, if (gdp->bg_flags & cpu_to_le16(EXT4_BG_INODE_ZEROED)) goto out; - handle = ext4_journal_start_sb(sb, 1); + handle = ext4_journal_start_sb_tryhard(sb, 1); if (IS_ERR(handle)) { ret = PTR_ERR(handle); goto out; diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index f2fa5e8..0c2b693 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -129,7 +129,7 @@ static handle_t *start_transaction(struct inode *inode) { handle_t *result; - result = ext4_journal_start(inode, blocks_for_truncate(inode)); + result = ext4_journal_start_tryhard(inode, blocks_for_truncate(inode)); if (!IS_ERR(result)) return result; @@ -204,7 +204,8 @@ void ext4_evict_inode(struct inode *inode) if (is_bad_inode(inode)) goto no_delete; - handle = ext4_journal_start(inode, blocks_for_truncate(inode)+3); + handle = ext4_journal_start_tryhard(inode, + blocks_for_truncate(inode)+3); if (IS_ERR(handle)) { ext4_std_error(inode->i_sb, PTR_ERR(handle)); /* @@ -1401,7 +1402,7 @@ static int _ext4_get_block(struct inode *inode, sector_t iblock, if (map.m_len > DIO_MAX_BLOCKS) map.m_len = DIO_MAX_BLOCKS; dio_credits = ext4_chunk_trans_blocks(inode, map.m_len); - handle = ext4_journal_start(inode, dio_credits); + handle = ext4_journal_start_tryhard(inode, dio_credits); if (IS_ERR(handle)) { ret = PTR_ERR(handle); return ret; @@ -2558,7 +2559,8 @@ static int __ext4_journalled_writepage(struct page *page, * references to buffers so we are safe */ unlock_page(page); - handle = ext4_journal_start(inode, ext4_writepage_trans_blocks(inode)); + handle = ext4_journal_start_tryhard(inode, + ext4_writepage_trans_blocks(inode)); if (IS_ERR(handle)) { ret = PTR_ERR(handle); goto out; @@ -2990,7 +2992,7 @@ retry: needed_blocks = ext4_da_writepages_trans_blocks(inode); /* start a new transaction*/ - handle = ext4_journal_start(inode, needed_blocks); + handle = ext4_journal_start_tryhard(inode, needed_blocks); if (IS_ERR(handle)) { ret = PTR_ERR(handle); ext4_msg(inode->i_sb, KERN_CRIT, "%s: jbd2_start: " @@ -5279,8 +5281,9 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) /* (user+group)*(old+new) structure, inode write (sb, * inode block, ? - but truncate inode update has it) */ - handle = ext4_journal_start(inode, (EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb)+ - EXT4_MAXQUOTAS_DEL_BLOCKS(inode->i_sb))+3); + handle = ext4_journal_start(inode, + (EXT4_MAXQUOTAS_INIT_BLOCKS(inode->i_sb)+ + EXT4_MAXQUOTAS_DEL_BLOCKS(inode->i_sb))+3); if (IS_ERR(handle)) { error = PTR_ERR(handle); goto err_out; @@ -5335,7 +5338,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) attr->ia_size); if (error) { /* Do as much error cleanup as possible */ - handle = ext4_journal_start(inode, 3); + handle = ext4_journal_start_tryhard(inode, 3); if (IS_ERR(handle)) { ext4_orphan_del(NULL, inode); goto err_out; @@ -5371,7 +5374,9 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) rc = ext4_acl_chmod(inode); err_out: - ext4_std_error(inode->i_sb, error); + if (error != -ENOMEM) { + ext4_std_error(inode->i_sb, error); + } if (!error) error = rc; return error; @@ -5687,7 +5692,7 @@ void ext4_dirty_inode(struct inode *inode) { handle_t *handle; - handle = ext4_journal_start(inode, 2); + handle = ext4_journal_start_tryhard(inode, 2); if (IS_ERR(handle)) goto out; @@ -5771,7 +5776,7 @@ int ext4_change_inode_journal_flag(struct inode *inode, int val) /* Finally we can mark the inode as dirty. */ - handle = ext4_journal_start(inode, 1); + handle = ext4_journal_start_tryhard(inode, 1); if (IS_ERR(handle)) return PTR_ERR(handle); diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 03eac6a..b0fc83e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4526,7 +4526,7 @@ static int ext4_write_dquot(struct dquot *dquot) struct inode *inode; inode = dquot_to_inode(dquot); - handle = ext4_journal_start(inode, + handle = ext4_journal_start_tryhard(inode, EXT4_QUOTA_TRANS_BLOCKS(dquot->dq_sb)); if (IS_ERR(handle)) return PTR_ERR(handle); @@ -4542,7 +4542,7 @@ static int ext4_acquire_dquot(struct dquot *dquot) int ret, err; handle_t *handle; - handle = ext4_journal_start(dquot_to_inode(dquot), + handle = ext4_journal_start_tryhard(dquot_to_inode(dquot), EXT4_QUOTA_INIT_BLOCKS(dquot->dq_sb)); if (IS_ERR(handle)) return PTR_ERR(handle); @@ -4558,7 +4558,7 @@ static int ext4_release_dquot(struct dquot *dquot) int ret, err; handle_t *handle; - handle = ext4_journal_start(dquot_to_inode(dquot), + handle = ext4_journal_start_tryhard(dquot_to_inode(dquot), EXT4_QUOTA_DEL_BLOCKS(dquot->dq_sb)); if (IS_ERR(handle)) { /* Release dquot anyway to avoid endless cycle in dqput() */ @@ -4590,7 +4590,7 @@ static int ext4_write_info(struct super_block *sb, int type) handle_t *handle; /* Data block + inode block */ - handle = ext4_journal_start(sb->s_root->d_inode, 2); + handle = ext4_journal_start_tryhard(sb->s_root->d_inode, 2); if (IS_ERR(handle)) return PTR_ERR(handle); ret = dquot_commit_info(sb, type); -- 1.7.1 -- Thanks - Manish --0016e6538572eb948904a1b32aba Content-Type: text/x-patch; charset=US-ASCII; name="0005-Update-ext4-routines-to-call-ext4_journal_start_tryh.patch" Content-Disposition: attachment; filename="0005-Update-ext4-routines-to-call-ext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