diff options
Diffstat (limited to 'fs/quota/quota_tree.c')
-rw-r--r-- | fs/quota/quota_tree.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c index e41c1becf096..d65877fbe8f4 100644 --- a/fs/quota/quota_tree.c +++ b/fs/quota/quota_tree.c | |||
@@ -22,9 +22,10 @@ MODULE_LICENSE("GPL"); | |||
22 | 22 | ||
23 | #define __QUOTA_QT_PARANOIA | 23 | #define __QUOTA_QT_PARANOIA |
24 | 24 | ||
25 | static int get_index(struct qtree_mem_dqinfo *info, qid_t id, int depth) | 25 | static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth) |
26 | { | 26 | { |
27 | unsigned int epb = info->dqi_usable_bs >> 2; | 27 | unsigned int epb = info->dqi_usable_bs >> 2; |
28 | qid_t id = from_kqid(&init_user_ns, qid); | ||
28 | 29 | ||
29 | depth = info->dqi_qtree_depth - depth - 1; | 30 | depth = info->dqi_qtree_depth - depth - 1; |
30 | while (depth--) | 31 | while (depth--) |
@@ -244,7 +245,7 @@ static uint find_free_dqentry(struct qtree_mem_dqinfo *info, | |||
244 | /* This is enough as the block is already zeroed and the entry | 245 | /* This is enough as the block is already zeroed and the entry |
245 | * list is empty... */ | 246 | * list is empty... */ |
246 | info->dqi_free_entry = blk; | 247 | info->dqi_free_entry = blk; |
247 | mark_info_dirty(dquot->dq_sb, dquot->dq_type); | 248 | mark_info_dirty(dquot->dq_sb, dquot->dq_id.type); |
248 | } | 249 | } |
249 | /* Block will be full? */ | 250 | /* Block will be full? */ |
250 | if (le16_to_cpu(dh->dqdh_entries) + 1 >= qtree_dqstr_in_blk(info)) { | 251 | if (le16_to_cpu(dh->dqdh_entries) + 1 >= qtree_dqstr_in_blk(info)) { |
@@ -357,7 +358,7 @@ static inline int dq_insert_tree(struct qtree_mem_dqinfo *info, | |||
357 | */ | 358 | */ |
358 | int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) | 359 | int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) |
359 | { | 360 | { |
360 | int type = dquot->dq_type; | 361 | int type = dquot->dq_id.type; |
361 | struct super_block *sb = dquot->dq_sb; | 362 | struct super_block *sb = dquot->dq_sb; |
362 | ssize_t ret; | 363 | ssize_t ret; |
363 | char *ddquot = getdqbuf(info->dqi_entry_size); | 364 | char *ddquot = getdqbuf(info->dqi_entry_size); |
@@ -538,8 +539,9 @@ static loff_t find_block_dqentry(struct qtree_mem_dqinfo *info, | |||
538 | ddquot += info->dqi_entry_size; | 539 | ddquot += info->dqi_entry_size; |
539 | } | 540 | } |
540 | if (i == qtree_dqstr_in_blk(info)) { | 541 | if (i == qtree_dqstr_in_blk(info)) { |
541 | quota_error(dquot->dq_sb, "Quota for id %u referenced " | 542 | quota_error(dquot->dq_sb, |
542 | "but not present", dquot->dq_id); | 543 | "Quota for id %u referenced but not present", |
544 | from_kqid(&init_user_ns, dquot->dq_id)); | ||
543 | ret = -EIO; | 545 | ret = -EIO; |
544 | goto out_buf; | 546 | goto out_buf; |
545 | } else { | 547 | } else { |
@@ -589,7 +591,7 @@ static inline loff_t find_dqentry(struct qtree_mem_dqinfo *info, | |||
589 | 591 | ||
590 | int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) | 592 | int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) |
591 | { | 593 | { |
592 | int type = dquot->dq_type; | 594 | int type = dquot->dq_id.type; |
593 | struct super_block *sb = dquot->dq_sb; | 595 | struct super_block *sb = dquot->dq_sb; |
594 | loff_t offset; | 596 | loff_t offset; |
595 | char *ddquot; | 597 | char *ddquot; |
@@ -607,8 +609,10 @@ int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) | |||
607 | offset = find_dqentry(info, dquot); | 609 | offset = find_dqentry(info, dquot); |
608 | if (offset <= 0) { /* Entry not present? */ | 610 | if (offset <= 0) { /* Entry not present? */ |
609 | if (offset < 0) | 611 | if (offset < 0) |
610 | quota_error(sb, "Can't read quota structure " | 612 | quota_error(sb,"Can't read quota structure " |
611 | "for id %u", dquot->dq_id); | 613 | "for id %u", |
614 | from_kqid(&init_user_ns, | ||
615 | dquot->dq_id)); | ||
612 | dquot->dq_off = 0; | 616 | dquot->dq_off = 0; |
613 | set_bit(DQ_FAKE_B, &dquot->dq_flags); | 617 | set_bit(DQ_FAKE_B, &dquot->dq_flags); |
614 | memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk)); | 618 | memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk)); |
@@ -626,7 +630,7 @@ int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) | |||
626 | if (ret >= 0) | 630 | if (ret >= 0) |
627 | ret = -EIO; | 631 | ret = -EIO; |
628 | quota_error(sb, "Error while reading quota structure for id %u", | 632 | quota_error(sb, "Error while reading quota structure for id %u", |
629 | dquot->dq_id); | 633 | from_kqid(&init_user_ns, dquot->dq_id)); |
630 | set_bit(DQ_FAKE_B, &dquot->dq_flags); | 634 | set_bit(DQ_FAKE_B, &dquot->dq_flags); |
631 | memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk)); | 635 | memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk)); |
632 | kfree(ddquot); | 636 | kfree(ddquot); |