]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.27.14/fuse-destroy-bdi-on-umount.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.27.14 / fuse-destroy-bdi-on-umount.patch
CommitLineData
72c67258
GKH
1From 26c3679101dbccc054dcf370143941844ba70531 Mon Sep 17 00:00:00 2001
2From: Miklos Szeredi <mszeredi@suse.cz>
3Date: Mon, 26 Jan 2009 15:00:59 +0100
4Subject: fuse: destroy bdi on umount
5
6From: Miklos Szeredi <mszeredi@suse.cz>
7
8commit 26c3679101dbccc054dcf370143941844ba70531 upstream.
9
10If a fuse filesystem is unmounted but the device file descriptor
11remains open and a new mount reuses the old device number, then the
12mount fails with EEXIST and the following warning is printed in the
13kernel log:
14
15 WARNING: at fs/sysfs/dir.c:462 sysfs_add_one+0x35/0x3d()
16 sysfs: duplicate filename '0:15' can not be created
17
18The cause is that the bdi belonging to the fuse filesystem was
19destoryed only after the device file was released. Fix this by
20calling bdi_destroy() from fuse_put_super() instead.
21
22Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
23Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
24
25---
26 fs/fuse/dev.c | 3 ++-
27 fs/fuse/inode.c | 2 +-
28 2 files changed, 3 insertions(+), 2 deletions(-)
29
30--- a/fs/fuse/dev.c
31+++ b/fs/fuse/dev.c
32@@ -281,7 +281,8 @@ static void request_end(struct fuse_conn
33 fc->blocked = 0;
34 wake_up_all(&fc->blocked_waitq);
35 }
36- if (fc->num_background == FUSE_CONGESTION_THRESHOLD) {
37+ if (fc->num_background == FUSE_CONGESTION_THRESHOLD &&
38+ fc->connected) {
39 clear_bdi_congested(&fc->bdi, READ);
40 clear_bdi_congested(&fc->bdi, WRITE);
41 }
42--- a/fs/fuse/inode.c
43+++ b/fs/fuse/inode.c
44@@ -292,6 +292,7 @@ static void fuse_put_super(struct super_
45 list_del(&fc->entry);
46 fuse_ctl_remove_conn(fc);
47 mutex_unlock(&fuse_mutex);
48+ bdi_destroy(&fc->bdi);
49 fuse_conn_put(fc);
50 }
51
52@@ -531,7 +532,6 @@ void fuse_conn_put(struct fuse_conn *fc)
53 if (fc->destroy_req)
54 fuse_request_free(fc->destroy_req);
55 mutex_destroy(&fc->inst_mutex);
56- bdi_destroy(&fc->bdi);
57 kfree(fc);
58 }
59 }