<div>Hi, Dave.<br></div><div><br></div><div>This patch looks much better. We have no objections. Thanks.</div><div><br></div><div>Vahram</div><br><div class="gmail_quote">On Sat, May 25, 2013 at 2:01 AM, Dave Kleikamp <span dir="ltr"><<a href="mailto:dave.kleikamp@oracle.com" target="_blank">dave.kleikamp@oracle.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Vahram,<br>
This is your first patch modified to be a little more robust. If there is<br>
no objection, I'll push it to linux-next along with Gu's nointegrity<br>
patch.<br>
<br>
From: Vahram Martirosyan <<a href="mailto:vmartirosyan@gmail.com">vmartirosyan@gmail.com</a>><br>
Date: Fri, 24 May 2013 13:57:12 +0500<br>
<div class="im"><br>
The mentioned functions do not pay attention to the error codes returned<br>
by the functions updateSuper(), lmLogInit() and lmLogShutdown(). It brings<br>
to system crash later when writing to log.<br>
<br>
The patch adds corresponding code to check and return the error codes<br>
and to print correct error messages in case of errors.<br>
<br>
</div><div class="im">Found by Linux File System Verification project (<a href="http://linuxtesting.org" target="_blank">linuxtesting.org</a>).<br>
<br>
Signed-off-by: Vahram Martirosyan <<a href="mailto:vahram.martirosyan@linuxtesting.org">vahram.martirosyan@linuxtesting.org</a>><br>
Reviewed-by: Gu Zheng <<a href="mailto:guz.fnst@cn.fujitsu.com">guz.fnst@cn.fujitsu.com</a>><br>
</div>Signed-off-by: Dave Kleikamp <<a href="mailto:dave.kleikamp@oracle.com">dave.kleikamp@oracle.com</a>><br>
---<br>
 fs/jfs/super.c | 38 ++++++++++++++++++++++++++++++--------<br>
 1 file changed, 30 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/fs/jfs/super.c b/fs/jfs/super.c<br>
index 2003e83..788e0a9 100644<br>
--- a/fs/jfs/super.c<br>
+++ b/fs/jfs/super.c<br>
@@ -611,11 +611,28 @@ static int jfs_freeze(struct super_block *sb)<br>
<div class="im"> {<br>
        struct jfs_sb_info *sbi = JFS_SBI(sb);<br>
        struct jfs_log *log = sbi->log;<br>
+       int rc = 0;<br>
<br>
        if (!(sb->s_flags & MS_RDONLY)) {<br>
                txQuiesce(sb);<br>
-               lmLogShutdown(log);<br>
-               updateSuper(sb, FM_CLEAN);<br>
+               rc = lmLogShutdown(log);<br>
</div>+               if (rc) {<br>
+                       jfs_error(sb, "jfs_freeze: lmLogShutdown failed");<br>
+<br>
+                       /* let operations fail rather than hang */<br>
+                       txResume(sb);<br>
+<br>
+                       return rc;<br>
<div class="im">+               }<br>
+               rc = updateSuper(sb, FM_CLEAN);<br>
</div>+               if (rc) {<br>
+                       jfs_err("jfs_freeze: updateSuper failed\n");<br>
+                       /*<br>
+                        * Don't fail here. Everything succeeded except<br>
+                        * marking the superblock clean, so there's really<br>
+                        * no harm in leaving it frozen for now.<br>
+                        */<br>
+               }<br>
        }<br>
        return 0;<br>
 }<br>
@@ -627,13 +644,18 @@ static int jfs_unfreeze(struct super_block *sb)<br>
<div class="im">        int rc = 0;<br>
<br>
        if (!(sb->s_flags & MS_RDONLY)) {<br>
-               updateSuper(sb, FM_MOUNT);<br>
-               if ((rc = lmLogInit(log)))<br>
-                       jfs_err("jfs_unlock failed with return code %d", rc);<br>
-               else<br>
-                       txResume(sb);<br>
+               rc = updateSuper(sb, FM_MOUNT);<br>
</div>+               if (rc) {<br>
+                       jfs_error(sb, "jfs_unfreeze: updateSuper failed");<br>
+                       goto out;<br>
<div class="im">+               }<br>
+               rc = lmLogInit(log);<br>
</div>+               if (rc)<br>
+                       jfs_error(sb, "jfs_unfreeze: lmLogInit failed");<br>
+out:<br>
+               txResume(sb);<br>
        }<br>
-       return 0;<br>
+       return rc;<br>
 }<br>
<br>
 static struct dentry *jfs_do_mount(struct file_system_type *fs_type,<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.2.3<br>
</font></span></blockquote></div><br>