1 Index: linux-stage/fs/ext4/super.c
2 ===================================================================
3 --- linux-stage.orig/fs/ext4/super.c
4 +++ linux-stage/fs/ext4/super.c
5 @@ -1117,9 +1117,53 @@ static ssize_t ext4_quota_read(struct su
6 static ssize_t ext4_quota_write(struct super_block *sb, int type,
7 const char *data, size_t len, loff_t off);
9 +static int ext4_dquot_initialize(struct inode *inode, int type)
14 + if (IS_NOQUOTA(inode))
17 + /* We may create quota structure so we need to reserve enough blocks */
18 + handle = ext4_journal_start(inode, 2*EXT4_QUOTA_INIT_BLOCKS(inode->i_sb));
20 + return PTR_ERR(handle);
21 + ret = dquot_initialize(inode, type);
22 + err = ext4_journal_stop(handle);
28 +static int ext4_dquot_drop(struct inode *inode)
33 + if (IS_NOQUOTA(inode))
36 + /* We may delete quota structure so we need to reserve enough blocks */
37 + handle = ext4_journal_start(inode, 2*EXT4_QUOTA_DEL_BLOCKS(inode->i_sb));
38 + if (IS_ERR(handle)) {
40 + * We call dquot_drop() anyway to at least release references
41 + * to quota structures so that umount does not hang.
44 + return PTR_ERR(handle);
46 + ret = dquot_drop(inode);
47 + err = ext4_journal_stop(handle);
53 static const struct dquot_operations ext4_quota_operations = {
54 - .initialize = dquot_initialize,
56 + .initialize = ext4_dquot_initialize,
57 + .drop = ext4_dquot_drop,
58 .alloc_space = dquot_alloc_space,
59 .reserve_space = dquot_reserve_space,
60 .claim_space = dquot_claim_space,