<div dir="ltr">Hi, Joseph.<div><br></div><div>Can you review this patch again, actually you had reviewed by</div><div><span style="font-size:14px"> '</span><a href="https://lkml.org/lkml/2015/2/27/655" target="_blank" style="font-size:14px">https://lkml.org/lkml/2015/2/27/655</a><span style="font-size:14px">'.</span><br></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">Thanks.</span></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">regards,</span></div><div><span style="font-size:14px">Daeseok Youn</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-19 14:43 GMT+09:00 Daeseok Youn <span dir="ltr"><<a href="mailto:daeseok.youn@gmail.com" target="_blank">daeseok.youn@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The use of 'status' in __ocfs2_add_entry() can return wrong<br>
value. Some functions' return value in __ocfs2_add_entry(),<br>
i.e ocfs2_journal_access_di() is saved to 'status'.<br>
But 'status' is not used in 'bail' label for returning result<br>
of __ocfs2_add_entry().<br>
<br>
So use retval instead of status.<br>
<br>
Signed-off-by: Daeseok Youn <<a href="mailto:daeseok.youn@gmail.com">daeseok.youn@gmail.com</a>><br>
---<br>
This patch was came from '<a href="https://lkml.org/lkml/2015/2/27/655" target="_blank">https://lkml.org/lkml/2015/2/27/655</a>'<br>
This patch was needed to test but I didn't have any environment<br>
for testing ocfs2 filesystem. But I have one, now.<br>
(I'm too busy to make this enviroment. And qemu for this fs is difficult<br>
for me. :-(, sorry for that)<br>
<br>
Briefly how to set my environment for testing this fs with qemu.<br>
1. Getting and building linux kernel with linux-next branch for x86_64 qemu.<br>
And also options of ocfs2 related are enabled(built-in)<br>
2. Makes own root file system with 'buildroot' project.<br>
3. Getting and building ocfs2-tools.<br>
Then binaries after building this tool are moved my rootfs.<br>
4. Makes dummy disk image(5G) which will be formatted in qemu.<br>
5. Booting qemu with rootfs image and dummy disk image.<br>
6. mkfs.ocfs2 --fs-feature=local <device><br>
this maybe possilbe to mount standalone mode.<br>
7. tunefs.ocfs2 --fs-features=indexed-dirs,noinline-data <device><br>
8. make a cluster and one node<br>
use o2cb_ctl tool.<br>
9. o2cb service load and initialize<br>
# /etc/init.d/o2cb load && /etc/init.d/o2cb configure<br>
# /etc/init.d/o2cb online<br>
10. mount ocfs2<br>
# mount.ocfs2 <device> <some directory><br>
<br>
And use GDB for debugging my patch path.<br>
Connect gdb with qemu and add breakpoint in __ocfs2_add_entry() of fs/ocfs2/dir.c<br>
<br>
And test my patch.<br>
# cd <some directory mounted with ocfs2><br>
# mkdir <specific directory><br>
<br>
This how-to is not written all my work, just briefly I said.<br>
<br>
fs/ocfs2/dir.c | 20 ++++++++++----------<br>
1 files changed, 10 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c<br>
index 990e8f7..a9513ff 100644<br>
--- a/fs/ocfs2/dir.c<br>
+++ b/fs/ocfs2/dir.c<br>
@@ -1607,7 +1607,7 @@ int __ocfs2_add_entry(handle_t *handle,<br>
struct ocfs2_dir_entry *de, *de1;<br>
struct ocfs2_dinode *di = (struct ocfs2_dinode *)parent_fe_bh->b_data;<br>
struct super_block *sb = dir->i_sb;<br>
- int retval, status;<br>
+ int retval;<br>
unsigned int size = sb->s_blocksize;<br>
struct buffer_head *insert_bh = lookup->dl_leaf_bh;<br>
char *data_start = insert_bh->b_data;<br>
@@ -1685,25 +1685,25 @@ int __ocfs2_add_entry(handle_t *handle,<br>
}<br>
<br>
if (insert_bh == parent_fe_bh)<br>
- status = ocfs2_journal_access_di(handle,<br>
+ retval = ocfs2_journal_access_di(handle,<br>
INODE_CACHE(dir),<br>
insert_bh,<br>
OCFS2_JOURNAL_ACCESS_WRITE);<br>
else {<br>
- status = ocfs2_journal_access_db(handle,<br>
+ retval = ocfs2_journal_access_db(handle,<br>
INODE_CACHE(dir),<br>
insert_bh,<br>
OCFS2_JOURNAL_ACCESS_WRITE);<br>
<br>
- if (ocfs2_dir_indexed(dir)) {<br>
- status = ocfs2_dx_dir_insert(dir,<br>
+ if (!retval && ocfs2_dir_indexed(dir))<br>
+ retval = ocfs2_dx_dir_insert(dir,<br>
handle,<br>
lookup);<br>
- if (status) {<br>
- mlog_errno(status);<br>
- goto bail;<br>
- }<br>
- }<br>
+ }<br>
+<br>
+ if (retval) {<br>
+ mlog_errno(retval);<br>
+ goto bail;<br>
}<br>
<br>
/* By now the buffer is marked for journaling */<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.1<br>
<br>
</font></span></blockquote></div><br></div>