<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"> &#39;</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">&#39;.</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">&lt;<a href="mailto:daeseok.youn@gmail.com" target="_blank">daeseok.youn@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The use of &#39;status&#39; in __ocfs2_add_entry() can return wrong<br>
value. Some functions&#39; return value in __ocfs2_add_entry(),<br>
i.e ocfs2_journal_access_di() is saved to &#39;status&#39;.<br>
But &#39;status&#39; is not used in &#39;bail&#39; label for returning result<br>
of __ocfs2_add_entry().<br>
<br>
So use retval instead of status.<br>
<br>
Signed-off-by: Daeseok Youn &lt;<a href="mailto:daeseok.youn@gmail.com">daeseok.youn@gmail.com</a>&gt;<br>
---<br>
This patch was came from &#39;<a href="https://lkml.org/lkml/2015/2/27/655" target="_blank">https://lkml.org/lkml/2015/2/27/655</a>&#39;<br>
This patch was needed to test but I didn&#39;t have any environment<br>
for testing ocfs2 filesystem. But I have one, now.<br>
(I&#39;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 &#39;buildroot&#39; 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 &lt;device&gt;<br>
  this maybe possilbe to mount standalone mode.<br>
7. tunefs.ocfs2  --fs-features=indexed-dirs,noinline-data &lt;device&gt;<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 &amp;&amp; /etc/init.d/o2cb configure<br>
  # /etc/init.d/o2cb online<br>
10. mount ocfs2<br>
  # mount.ocfs2 &lt;device&gt; &lt;some directory&gt;<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 &lt;some directory mounted with ocfs2&gt;<br>
# mkdir &lt;specific directory&gt;<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-&gt;b_data;<br>
        struct super_block *sb = dir-&gt;i_sb;<br>
-       int retval, status;<br>
+       int retval;<br>
        unsigned int size = sb-&gt;s_blocksize;<br>
        struct buffer_head *insert_bh = lookup-&gt;dl_leaf_bh;<br>
        char *data_start = insert_bh-&gt;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 &amp;&amp; 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>