diff options
Diffstat (limited to 'fs/ocfs2/quota_local.c')
-rw-r--r-- | fs/ocfs2/quota_local.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c index f100bf70a906..27fe7ee4874c 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c | |||
@@ -501,7 +501,9 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode, | |||
501 | } | 501 | } |
502 | dqblk = (struct ocfs2_local_disk_dqblk *)(qbh->b_data + | 502 | dqblk = (struct ocfs2_local_disk_dqblk *)(qbh->b_data + |
503 | ol_dqblk_block_off(sb, chunk, bit)); | 503 | ol_dqblk_block_off(sb, chunk, bit)); |
504 | dquot = dqget(sb, le64_to_cpu(dqblk->dqb_id), type); | 504 | dquot = dqget(sb, |
505 | make_kqid(&init_user_ns, type, | ||
506 | le64_to_cpu(dqblk->dqb_id))); | ||
505 | if (!dquot) { | 507 | if (!dquot) { |
506 | status = -EIO; | 508 | status = -EIO; |
507 | mlog(ML_ERROR, "Failed to get quota structure " | 509 | mlog(ML_ERROR, "Failed to get quota structure " |
@@ -881,7 +883,8 @@ static void olq_set_dquot(struct buffer_head *bh, void *private) | |||
881 | dqblk = (struct ocfs2_local_disk_dqblk *)(bh->b_data | 883 | dqblk = (struct ocfs2_local_disk_dqblk *)(bh->b_data |
882 | + ol_dqblk_block_offset(sb, od->dq_local_off)); | 884 | + ol_dqblk_block_offset(sb, od->dq_local_off)); |
883 | 885 | ||
884 | dqblk->dqb_id = cpu_to_le64(od->dq_dquot.dq_id); | 886 | dqblk->dqb_id = cpu_to_le64(from_kqid(&init_user_ns, |
887 | od->dq_dquot.dq_id)); | ||
885 | spin_lock(&dq_data_lock); | 888 | spin_lock(&dq_data_lock); |
886 | dqblk->dqb_spacemod = cpu_to_le64(od->dq_dquot.dq_dqb.dqb_curspace - | 889 | dqblk->dqb_spacemod = cpu_to_le64(od->dq_dquot.dq_dqb.dqb_curspace - |
887 | od->dq_origspace); | 890 | od->dq_origspace); |
@@ -891,7 +894,7 @@ static void olq_set_dquot(struct buffer_head *bh, void *private) | |||
891 | trace_olq_set_dquot( | 894 | trace_olq_set_dquot( |
892 | (unsigned long long)le64_to_cpu(dqblk->dqb_spacemod), | 895 | (unsigned long long)le64_to_cpu(dqblk->dqb_spacemod), |
893 | (unsigned long long)le64_to_cpu(dqblk->dqb_inodemod), | 896 | (unsigned long long)le64_to_cpu(dqblk->dqb_inodemod), |
894 | od->dq_dquot.dq_id); | 897 | from_kqid(&init_user_ns, od->dq_dquot.dq_id)); |
895 | } | 898 | } |
896 | 899 | ||
897 | /* Write dquot to local quota file */ | 900 | /* Write dquot to local quota file */ |
@@ -900,7 +903,7 @@ int ocfs2_local_write_dquot(struct dquot *dquot) | |||
900 | struct super_block *sb = dquot->dq_sb; | 903 | struct super_block *sb = dquot->dq_sb; |
901 | struct ocfs2_dquot *od = OCFS2_DQUOT(dquot); | 904 | struct ocfs2_dquot *od = OCFS2_DQUOT(dquot); |
902 | struct buffer_head *bh; | 905 | struct buffer_head *bh; |
903 | struct inode *lqinode = sb_dqopt(sb)->files[dquot->dq_type]; | 906 | struct inode *lqinode = sb_dqopt(sb)->files[dquot->dq_id.type]; |
904 | int status; | 907 | int status; |
905 | 908 | ||
906 | status = ocfs2_read_quota_phys_block(lqinode, od->dq_local_phys_blk, | 909 | status = ocfs2_read_quota_phys_block(lqinode, od->dq_local_phys_blk, |
@@ -1221,7 +1224,7 @@ static void olq_alloc_dquot(struct buffer_head *bh, void *private) | |||
1221 | int ocfs2_create_local_dquot(struct dquot *dquot) | 1224 | int ocfs2_create_local_dquot(struct dquot *dquot) |
1222 | { | 1225 | { |
1223 | struct super_block *sb = dquot->dq_sb; | 1226 | struct super_block *sb = dquot->dq_sb; |
1224 | int type = dquot->dq_type; | 1227 | int type = dquot->dq_id.type; |
1225 | struct inode *lqinode = sb_dqopt(sb)->files[type]; | 1228 | struct inode *lqinode = sb_dqopt(sb)->files[type]; |
1226 | struct ocfs2_quota_chunk *chunk; | 1229 | struct ocfs2_quota_chunk *chunk; |
1227 | struct ocfs2_dquot *od = OCFS2_DQUOT(dquot); | 1230 | struct ocfs2_dquot *od = OCFS2_DQUOT(dquot); |
@@ -1275,7 +1278,7 @@ out: | |||
1275 | int ocfs2_local_release_dquot(handle_t *handle, struct dquot *dquot) | 1278 | int ocfs2_local_release_dquot(handle_t *handle, struct dquot *dquot) |
1276 | { | 1279 | { |
1277 | int status; | 1280 | int status; |
1278 | int type = dquot->dq_type; | 1281 | int type = dquot->dq_id.type; |
1279 | struct ocfs2_dquot *od = OCFS2_DQUOT(dquot); | 1282 | struct ocfs2_dquot *od = OCFS2_DQUOT(dquot); |
1280 | struct super_block *sb = dquot->dq_sb; | 1283 | struct super_block *sb = dquot->dq_sb; |
1281 | struct ocfs2_local_disk_chunk *dchunk; | 1284 | struct ocfs2_local_disk_chunk *dchunk; |