<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Fix for unionfs oops</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>I ran into this issue when trying to enable LVM in the Ubuntu 8.04 LiveCD.<BR>
<BR>
I tracked down the issue just far enough to get a minimal fix for the oops.<BR>
The problem is that unionfs_file_revalidate() calls is_robranch(dentry),<BR>
which has the statement &quot;IS_RDONLY(dtohd_index(dentry, index)-&gt;d_inode)&quot;.<BR>
The value inside the macro is NULL, which causes the oops.<BR>
<BR>
I'm not familiar enough with the unionfs code to know why it happens, what<BR>
should be happening, or how it should be fixed.&nbsp; Perhaps someone who is more<BR>
familiar with unionfs code can take this information and fix it properly.<BR>
<BR>
<BR>
--- a/ubuntu/fs/unionfs/unionfs.h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2008-06-10 09:57:18.000000000 -0700<BR>
+++ b/ubuntu/fs/unionfs/unionfs.h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2008-07-08 21:49:31.785146021 -0700<BR>
@@ -574,15 +574,16 @@<BR>
&nbsp;{<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int err = 0;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int perms;<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct inode *i;<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print_util_entry_location();<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BUG_ON(index &lt; 0);<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; perms = stopd(dentry-&gt;d_sb)-&gt;usi_data[index].branchperms;<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i = dtohd_index(dentry, index)-&gt;d_inode;<BR>
<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((!(perms &amp; MAY_WRITE))<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; || (IS_RDONLY(dtohd_index(dentry, index)-&gt;d_inode)))<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!(perms &amp; MAY_WRITE) || (i &amp;&amp; IS_RDONLY(i)))<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; err = -EROFS;<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print_util_exit_status(err);<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>