From: DaeSeok Youn <daeseok.youn@gmail.com> To: Joseph Qi <joseph.qi@huawei.com> Cc: mfasheh@suse.com, Andrew Morton <akpm@linux-foundation.org>, Richard Weinberger <richard.weinberger@gmail.com>, "ocfs2-devel@oss.oracle.com" <ocfs2-devel@oss.oracle.com>, linux-kernel <linux-kernel@vger.kernel.org> Subject: Re: [Ocfs2-devel] [PATCH 1/4 V2] ocfs2: use retval instead of status for checking error Date: Fri, 20 Mar 2015 11:22:53 +0900 [thread overview] Message-ID: <CAHb8M2AXygqC5tJZrE7qKu_9+0rB4qzQFvM5uAR9F80X01Rx8A@mail.gmail.com> (raw) In-Reply-To: <550A6BB3.5000901@huawei.com> 2015-03-19 15:24 GMT+09:00 Joseph Qi <joseph.qi@huawei.com>: > Looks good to me. > > On 2015/2/28 7:48, Daeseok Youn wrote: >> The use of 'status' in __ocfs2_add_entry() can return wrong >> status when some functions are failed. >> >> If ocfs2_journal_access_db() in __ocfs2_add_entry() is failed, >> that status is saved to 'status' but return variable is 'retval' >> which is saved 'success' status. In case of this, __ocfs2_add_entry() >> is failed but can be returned as 'success'. >> >> So replace 'status' with 'retval'. >> >> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> > > Reviewed-by: Joseph Qi <joseph.qi@huawei.com> Hi, Joseph. Thanks for review this patch. I have actually tried to set this file system on my machine with qemu but I didn't success, yet. Regards, Daeseok Youn. >> --- >> V2 : update changelog >> >> fs/ocfs2/dir.c | 12 ++++++------ >> 1 files changed, 6 insertions(+), 6 deletions(-) >> >> diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c >> index b08050b..1478a50 100644 >> --- a/fs/ocfs2/dir.c >> +++ b/fs/ocfs2/dir.c >> @@ -1617,7 +1617,7 @@ int __ocfs2_add_entry(handle_t *handle, >> struct ocfs2_dir_entry *de, *de1; >> struct ocfs2_dinode *di = (struct ocfs2_dinode *)parent_fe_bh->b_data; >> struct super_block *sb = dir->i_sb; >> - int retval, status; >> + int retval; >> unsigned int size = sb->s_blocksize; >> struct buffer_head *insert_bh = lookup->dl_leaf_bh; >> char *data_start = insert_bh->b_data; >> @@ -1695,22 +1695,22 @@ int __ocfs2_add_entry(handle_t *handle, >> } >> >> if (insert_bh == parent_fe_bh) >> - status = ocfs2_journal_access_di(handle, >> + retval = ocfs2_journal_access_di(handle, >> INODE_CACHE(dir), >> insert_bh, >> OCFS2_JOURNAL_ACCESS_WRITE); >> else { >> - status = ocfs2_journal_access_db(handle, >> + retval = ocfs2_journal_access_db(handle, >> INODE_CACHE(dir), >> insert_bh, >> OCFS2_JOURNAL_ACCESS_WRITE); >> >> if (ocfs2_dir_indexed(dir)) { >> - status = ocfs2_dx_dir_insert(dir, >> + retval = ocfs2_dx_dir_insert(dir, >> handle, >> lookup); >> - if (status) { >> - mlog_errno(status); >> + if (retval) { >> + mlog_errno(retval); >> goto bail; >> } >> } >> > >
WARNING: multiple messages have this Message-ID (diff)
From: DaeSeok Youn <daeseok.youn@gmail.com> To: Joseph Qi <joseph.qi@huawei.com> Cc: mfasheh@suse.com, Andrew Morton <akpm@linux-foundation.org>, Richard Weinberger <richard.weinberger@gmail.com>, "ocfs2-devel@oss.oracle.com" <ocfs2-devel@oss.oracle.com>, linux-kernel <linux-kernel@vger.kernel.org> Subject: [Ocfs2-devel] [PATCH 1/4 V2] ocfs2: use retval instead of status for checking error Date: Fri, 20 Mar 2015 11:22:53 +0900 [thread overview] Message-ID: <CAHb8M2AXygqC5tJZrE7qKu_9+0rB4qzQFvM5uAR9F80X01Rx8A@mail.gmail.com> (raw) In-Reply-To: <550A6BB3.5000901@huawei.com> 2015-03-19 15:24 GMT+09:00 Joseph Qi <joseph.qi@huawei.com>: > Looks good to me. > > On 2015/2/28 7:48, Daeseok Youn wrote: >> The use of 'status' in __ocfs2_add_entry() can return wrong >> status when some functions are failed. >> >> If ocfs2_journal_access_db() in __ocfs2_add_entry() is failed, >> that status is saved to 'status' but return variable is 'retval' >> which is saved 'success' status. In case of this, __ocfs2_add_entry() >> is failed but can be returned as 'success'. >> >> So replace 'status' with 'retval'. >> >> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> > > Reviewed-by: Joseph Qi <joseph.qi@huawei.com> Hi, Joseph. Thanks for review this patch. I have actually tried to set this file system on my machine with qemu but I didn't success, yet. Regards, Daeseok Youn. >> --- >> V2 : update changelog >> >> fs/ocfs2/dir.c | 12 ++++++------ >> 1 files changed, 6 insertions(+), 6 deletions(-) >> >> diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c >> index b08050b..1478a50 100644 >> --- a/fs/ocfs2/dir.c >> +++ b/fs/ocfs2/dir.c >> @@ -1617,7 +1617,7 @@ int __ocfs2_add_entry(handle_t *handle, >> struct ocfs2_dir_entry *de, *de1; >> struct ocfs2_dinode *di = (struct ocfs2_dinode *)parent_fe_bh->b_data; >> struct super_block *sb = dir->i_sb; >> - int retval, status; >> + int retval; >> unsigned int size = sb->s_blocksize; >> struct buffer_head *insert_bh = lookup->dl_leaf_bh; >> char *data_start = insert_bh->b_data; >> @@ -1695,22 +1695,22 @@ int __ocfs2_add_entry(handle_t *handle, >> } >> >> if (insert_bh == parent_fe_bh) >> - status = ocfs2_journal_access_di(handle, >> + retval = ocfs2_journal_access_di(handle, >> INODE_CACHE(dir), >> insert_bh, >> OCFS2_JOURNAL_ACCESS_WRITE); >> else { >> - status = ocfs2_journal_access_db(handle, >> + retval = ocfs2_journal_access_db(handle, >> INODE_CACHE(dir), >> insert_bh, >> OCFS2_JOURNAL_ACCESS_WRITE); >> >> if (ocfs2_dir_indexed(dir)) { >> - status = ocfs2_dx_dir_insert(dir, >> + retval = ocfs2_dx_dir_insert(dir, >> handle, >> lookup); >> - if (status) { >> - mlog_errno(status); >> + if (retval) { >> + mlog_errno(retval); >> goto bail; >> } >> } >> > >
next prev parent reply other threads:[~2015-03-20 2:22 UTC|newest] Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-02-27 23:48 [PATCH 1/4 V2] ocfs2: use retval instead of status for checking error Daeseok Youn 2015-02-27 23:48 ` [Ocfs2-devel] " Daeseok Youn 2015-03-02 9:04 ` Richard Weinberger 2015-03-02 9:04 ` [Ocfs2-devel] " Richard Weinberger 2015-03-03 1:38 ` DaeSeok Youn 2015-03-03 1:38 ` [Ocfs2-devel] " DaeSeok Youn 2015-03-05 9:36 ` DaeSeok Youn 2015-03-05 9:36 ` [Ocfs2-devel] " DaeSeok Youn 2015-03-13 3:59 ` DaeSeok Youn 2015-03-13 3:59 ` [Ocfs2-devel] " DaeSeok Youn 2015-03-13 8:15 ` Richard Weinberger 2015-03-13 8:15 ` [Ocfs2-devel] " Richard Weinberger 2015-03-13 11:14 ` DaeSeok Youn 2015-03-19 6:24 ` Joseph Qi 2015-03-19 6:24 ` Joseph Qi 2015-03-20 2:22 ` DaeSeok Youn [this message] 2015-03-20 2:22 ` DaeSeok Youn 2015-03-19 22:23 ` Andrew Morton 2015-03-19 22:23 ` [Ocfs2-devel] " Andrew Morton 2015-03-20 1:17 ` Joseph Qi 2015-03-20 1:17 ` Joseph Qi 2015-03-24 6:17 ` DaeSeok Youn 2015-03-24 6:17 ` DaeSeok Youn
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=CAHb8M2AXygqC5tJZrE7qKu_9+0rB4qzQFvM5uAR9F80X01Rx8A@mail.gmail.com \ --to=daeseok.youn@gmail.com \ --cc=akpm@linux-foundation.org \ --cc=joseph.qi@huawei.com \ --cc=linux-kernel@vger.kernel.org \ --cc=mfasheh@suse.com \ --cc=ocfs2-devel@oss.oracle.com \ --cc=richard.weinberger@gmail.com \ /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: linkBe 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.