Commit 182374a0 authored by Evgeniy Polyakov's avatar Evgeniy Polyakov Committed by Greg Kroah-Hartman

Staging: Fixed pohmelfs regression because of per-bdi writeback.

Since pohmelfs isn't tied to a single block device, it needs to setup a
backing dev like nfs/btrfs/etc do.
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarEvgeniy Polyakov <zbr@ioremap.net>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e3c0acf4
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#define POHMELFS_MAGIC_NUM 0x504f482e #define POHMELFS_MAGIC_NUM 0x504f482e
static struct kmem_cache *pohmelfs_inode_cache; static struct kmem_cache *pohmelfs_inode_cache;
static atomic_t psb_bdi_num = ATOMIC_INIT(0);
/* /*
* Removes inode from all trees, drops local name cache and removes all queued * Removes inode from all trees, drops local name cache and removes all queued
...@@ -1331,6 +1332,8 @@ static void pohmelfs_put_super(struct super_block *sb) ...@@ -1331,6 +1332,8 @@ static void pohmelfs_put_super(struct super_block *sb)
pohmelfs_crypto_exit(psb); pohmelfs_crypto_exit(psb);
pohmelfs_state_exit(psb); pohmelfs_state_exit(psb);
bdi_destroy(&psb->bdi);
kfree(psb); kfree(psb);
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
} }
...@@ -1814,11 +1817,22 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -1814,11 +1817,22 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
if (!psb) if (!psb)
goto err_out_exit; goto err_out_exit;
err = bdi_init(&psb->bdi);
if (err)
goto err_out_free_sb;
err = bdi_register(&psb->bdi, NULL, "pfs-%d", atomic_inc_return(&psb_bdi_num));
if (err) {
bdi_destroy(&psb->bdi);
goto err_out_free_sb;
}
sb->s_fs_info = psb; sb->s_fs_info = psb;
sb->s_op = &pohmelfs_sb_ops; sb->s_op = &pohmelfs_sb_ops;
sb->s_magic = POHMELFS_MAGIC_NUM; sb->s_magic = POHMELFS_MAGIC_NUM;
sb->s_maxbytes = MAX_LFS_FILESIZE; sb->s_maxbytes = MAX_LFS_FILESIZE;
sb->s_blocksize = PAGE_SIZE; sb->s_blocksize = PAGE_SIZE;
sb->s_bdi = &psb->bdi;
psb->sb = sb; psb->sb = sb;
...@@ -1862,11 +1876,11 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -1862,11 +1876,11 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
err = pohmelfs_parse_options((char *) data, psb, 0); err = pohmelfs_parse_options((char *) data, psb, 0);
if (err) if (err)
goto err_out_free_sb; goto err_out_free_bdi;
err = pohmelfs_copy_crypto(psb); err = pohmelfs_copy_crypto(psb);
if (err) if (err)
goto err_out_free_sb; goto err_out_free_bdi;
err = pohmelfs_state_init(psb); err = pohmelfs_state_init(psb);
if (err) if (err)
...@@ -1915,6 +1929,8 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -1915,6 +1929,8 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
err_out_free_strings: err_out_free_strings:
kfree(psb->cipher_string); kfree(psb->cipher_string);
kfree(psb->hash_string); kfree(psb->hash_string);
err_out_free_bdi:
bdi_destroy(&psb->bdi);
err_out_free_sb: err_out_free_sb:
kfree(psb); kfree(psb);
err_out_exit: err_out_exit:
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/connector.h> #include <linux/connector.h>
#include <linux/backing-dev.h>
#define POHMELFS_CN_IDX 5 #define POHMELFS_CN_IDX 5
#define POHMELFS_CN_VAL 0 #define POHMELFS_CN_VAL 0
...@@ -624,6 +625,8 @@ struct pohmelfs_sb { ...@@ -624,6 +625,8 @@ struct pohmelfs_sb {
struct super_block *sb; struct super_block *sb;
struct backing_dev_info bdi;
/* /*
* Algorithm strings. * Algorithm strings.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment