1 diff -up a/fs/ext4/super.c b/s/ext4/super.c
4 @@ -706,9 +767,47 @@ static inline struct inode *dquot_to_ino
5 static ssize_t ext4_quota_write(struct super_block *sb, int type,
6 const char *data, size_t len, loff_t off);
8 +static int ext4_dquot_initialize(struct inode *inode, int type)
13 + /* We may create quota structure so we need to reserve enough blocks */
14 + handle = ext4_journal_start(inode, 2*EXT4_QUOTA_INIT_BLOCKS(inode->i_sb));
16 + return PTR_ERR(handle);
17 + ret = dquot_initialize(inode, type);
18 + err = ext4_journal_stop(handle);
24 +static int ext4_dquot_drop(struct inode *inode)
29 + /* We may delete quota structure so we need to reserve enough blocks */
30 + handle = ext4_journal_start(inode, 2*EXT4_QUOTA_DEL_BLOCKS(inode->i_sb));
31 + if (IS_ERR(handle)) {
33 + * We call dquot_drop() anyway to at least release references
34 + * to quota structures so that umount does not hang.
37 + return PTR_ERR(handle);
39 + ret = dquot_drop(inode);
40 + err = ext4_journal_stop(handle);
46 static struct dquot_operations ext4_quota_operations = {
47 - .initialize = dquot_initialize,
49 + .initialize = ext4_dquot_initialize,
50 + .drop = ext4_dquot_drop,
51 .alloc_space = dquot_alloc_space,
52 .alloc_inode = dquot_alloc_inode,
53 .free_space = dquot_free_space,