<!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 "IS_RDONLY(dtohd_index(dentry, index)->d_inode)".<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. 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 2008-06-10 09:57:18.000000000 -0700<BR>
+++ b/ubuntu/fs/unionfs/unionfs.h 2008-07-08 21:49:31.785146021 -0700<BR>
@@ -574,15 +574,16 @@<BR>
{<BR>
int err = 0;<BR>
int perms;<BR>
+ struct inode *i;<BR>
<BR>
print_util_entry_location();<BR>
<BR>
BUG_ON(index < 0);<BR>
<BR>
perms = stopd(dentry->d_sb)->usi_data[index].branchperms;<BR>
+ i = dtohd_index(dentry, index)->d_inode;<BR>
<BR>
- if ((!(perms & MAY_WRITE))<BR>
- || (IS_RDONLY(dtohd_index(dentry, index)->d_inode)))<BR>
+ if (!(perms & MAY_WRITE) || (i && IS_RDONLY(i)))<BR>
err = -EROFS;<BR>
<BR>
print_util_exit_status(err);<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>