From: Miklos Szeredi <miklos@szeredi.hu>

In the prevous fix (fix busy inodes after unmount) I forgot to protect
against concurrent modification of the background list.  This patch adds
the necessary locking.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 fs/fuse/dev.c    |    4 ++++
 fs/fuse/fuse_i.h |    1 +
 2 files changed, 5 insertions(+)

diff -puN fs/fuse/dev.c~fuse-mount-options-fix-fix fs/fuse/dev.c
--- 25/fs/fuse/dev.c~fuse-mount-options-fix-fix	2005-05-10 02:22:02.000000000 -0700
+++ 25-akpm/fs/fuse/dev.c	2005-05-10 02:22:02.000000000 -0700
@@ -152,7 +152,9 @@ void fuse_release_background(struct fuse
 	iput(req->inode2);
 	if (req->file)
 		fput(req->file);
+	spin_lock(&fuse_lock);
 	list_del(&req->bg_entry);
+	spin_unlock(&fuse_lock);
 }
 
 /*
@@ -382,7 +384,9 @@ void request_send_noreply(struct fuse_co
 void request_send_background(struct fuse_conn *fc, struct fuse_req *req)
 {
 	req->isreply = 1;
+	spin_lock(&fuse_lock);
 	background_request(fc, req);
+	spin_unlock(&fuse_lock);
 	request_send_nowait(fc, req);
 }
 
diff -puN fs/fuse/fuse_i.h~fuse-mount-options-fix-fix fs/fuse/fuse_i.h
--- 25/fs/fuse/fuse_i.h~fuse-mount-options-fix-fix	2005-05-10 02:22:02.000000000 -0700
+++ 25-akpm/fs/fuse/fuse_i.h	2005-05-10 02:22:02.000000000 -0700
@@ -294,6 +294,7 @@ extern struct file_operations fuse_dev_o
  *  - the private_data field of the device file
  *  - the s_fs_info field of the super block
  *  - unused_list, pending, processing lists in fuse_conn
+ *  - background list in fuse_conn
  *  - the unique request ID counter reqctr in fuse_conn
  *  - the sb (super_block) field in fuse_conn
  *  - the file (device file) field in fuse_conn
_