From b6117f16f52a02735d650165cb92d5b9941a1e8c Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 13 Feb 2008 16:33:27 +0000 Subject: [PATCH] Add missing bdi_init() and bdi_destroy() calls... --- ChangeLog | 6 ++++++ kernel/inode.c | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index bb93b44..1a1eea4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-13 Miklos Szeredi + + * Add missing bdi_init() and bdi_destroy() calls for 2.6.24 + kernel. Lack of bdi_init() could cause write to hang. Report + forwarded by Szakacsits Szabolcs from the NTFS-3G forum. + 2008-02-03 Csaba Henk * lib/mount_bsd.c: diff --git a/kernel/inode.c b/kernel/inode.c index 0a5900e..4e099b2 100644 --- a/kernel/inode.c +++ b/kernel/inode.c @@ -470,6 +470,13 @@ static struct fuse_conn *new_conn(void) fc = kzalloc(sizeof(*fc), GFP_KERNEL); if (fc) { +#ifdef KERNEL_2_6_24_PLUS + int err = bdi_init(&fc->bdi); + if (err) { + kfree(fc); + return NULL; + } +#endif spin_lock_init(&fc->lock); mutex_init(&fc->inst_mutex); atomic_set(&fc->count, 1); @@ -496,6 +503,9 @@ void fuse_conn_put(struct fuse_conn *fc) if (fc->destroy_req) fuse_request_free(fc->destroy_req); mutex_destroy(&fc->inst_mutex); +#ifdef KERNEL_2_6_24_PLUS + bdi_destroy(&fc->bdi); +#endif kfree(fc); } } -- 2.30.2