Re: Recent development patches

Mikael Pettersson <[email protected]>
Newsgroups gmane.linux.swsusp.devel
Message-ID <[email protected]>
Sven Hartge writes:
> Mikael Pettersson <[email protected]> wrote:
> 
> > Anyway, in <http://user.it.uu.se/~mikpe/linux/patches/tuxonice/>
> > you'll find my forward-ports of tuxonice-3.2 to the 3.0/3.1/3.2-rc4
> > kernels.  Compile-tested on x86_64 and i686, but only lightly
> > runtime tested.  No guarantees etc.
> 
> Thanks for those patches, but this patch ontop of 3.1.4 fails inside
> fuse.c:
> 
>   CC [M]  fs/fuse/file.o
> fs/fuse/file.c: In function ‘fuse_do_ioctl’:
> fs/fuse/file.c:1835:31: error: ‘inode’ undeclared (first use in this function)
> fs/fuse/file.c:1835:31: note: each undeclared identifier is reported only once for each function it appears in
> 
> Code in line 1835 is:
> 
>   FUSE_MIGHT_FREEZE(inode->i_sb, "fuse_buffered_write");
>   
> I have no idea, but to me it looks like this should look more like
>  
>   FUSE_MIGHT_FREEZE(file->....., "fuse_do_ioctl");
> 
> with "inode" replaced by "file" and so on.

The fuse problem was caused by changes between kernel 3.0 and 3.1
that in turn caused patch to mis-apply parts of the patch for fuse/file.c.
I didn't notice because I don't use or enable fuse.

The patch below (apply on top of kernel + baseline tuxonice patch) fixes
it for both kernel 3.1 and 3.2-rc4.

/Mikael

--- linux-3.1/fs/fuse/file.c.~1~	2011-12-06 10:10:25.000000000 +0100
+++ linux-3.1/fs/fuse/file.c	2011-12-06 10:41:23.000000000 +0100
@@ -1052,6 +1052,8 @@ ssize_t fuse_direct_io(struct file *file
 	ssize_t res = 0;
 	struct fuse_req *req;
 
+	FUSE_MIGHT_FREEZE(file->f_mapping->host->i_sb, "fuse_direct_io");
+
 	req = fuse_get_req(fc);
 	if (IS_ERR(req))
 		return PTR_ERR(req);
@@ -1832,8 +1834,6 @@ long fuse_do_ioctl(struct file *file, un
 	if (!pages || !iov_page)
 		goto out;
 
-	FUSE_MIGHT_FREEZE(inode->i_sb, "fuse_buffered_write");
-
 	/*
 	 * If restricted, initialize IO parameters as encoded in @cmd.
 	 * RETRY from server is not allowed.
@@ -2080,8 +2080,6 @@ unsigned fuse_file_poll(struct file *fil
 		fuse_register_polled_file(fc, ff);
 	}
 
-	FUSE_MIGHT_FREEZE(file->f_mapping->host->i_sb, "fuse_direct_io");
-
 	req = fuse_get_req(fc);
 	if (IS_ERR(req))
 		return POLLERR;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.