]>
Commit | Line | Data |
---|---|---|
72c67258 GKH |
1 | From 26c3679101dbccc054dcf370143941844ba70531 Mon Sep 17 00:00:00 2001 |
2 | From: Miklos Szeredi <mszeredi@suse.cz> | |
3 | Date: Mon, 26 Jan 2009 15:00:59 +0100 | |
4 | Subject: fuse: destroy bdi on umount | |
5 | ||
6 | From: Miklos Szeredi <mszeredi@suse.cz> | |
7 | ||
8 | commit 26c3679101dbccc054dcf370143941844ba70531 upstream. | |
9 | ||
10 | If a fuse filesystem is unmounted but the device file descriptor | |
11 | remains open and a new mount reuses the old device number, then the | |
12 | mount fails with EEXIST and the following warning is printed in the | |
13 | kernel 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 | ||
18 | The cause is that the bdi belonging to the fuse filesystem was | |
19 | destoryed only after the device file was released. Fix this by | |
20 | calling bdi_destroy() from fuse_put_super() instead. | |
21 | ||
22 | Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> | |
23 | Signed-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 | } |