Bug#420583: Fix for unionfs oops

Thomas Marshall tdm at f5.com
Wed Jul 9 17:26:37 UTC 2008


I ran into this issue when trying to enable LVM in the Ubuntu 8.04 LiveCD.

I tracked down the issue just far enough to get a minimal fix for the oops. 
The problem is that unionfs_file_revalidate() calls is_robranch(dentry),
which has the statement "IS_RDONLY(dtohd_index(dentry, index)->d_inode)". 
The value inside the macro is NULL, which causes the oops.

I'm not familiar enough with the unionfs code to know why it happens, what
should be happening, or how it should be fixed.  Perhaps someone who is more
familiar with unionfs code can take this information and fix it properly.


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/pkg-lvm-maintainers/attachments/20080709/77e15cc6/attachment.htm 


More information about the pkg-lvm-maintainers mailing list