Add missing bdi_init() and bdi_destroy() calls...
authorMiklos Szeredi <miklos@szeredi.hu>
Wed, 13 Feb 2008 16:33:27 +0000 (16:33 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Wed, 13 Feb 2008 16:33:27 +0000 (16:33 +0000)
ChangeLog
kernel/inode.c

index bb93b44daf3aadc3a9f4f6e44f187c8f63be50d8..1a1eea463e2ccd45d9ce65bf1b980fe24ede9780 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-02-13  Miklos Szeredi <miklos@szeredi.hu>
+
+       * 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 <csaba.henk@creo.hu>
 
        * lib/mount_bsd.c:
index 0a5900edb76bcb3f9e83f4a657a7e7f91ca5e036..4e099b2da17a929767d2367e9bd6b1a9383d8fce 100644 (file)
@@ -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);
        }
 }