dma/ia64: update ia64 machvecs, swiotlb.c
[safe/jmp/linux-2.6] / fs / quota_v2.c
index 19bdb7b..23b647f 100644 (file)
@@ -35,7 +35,8 @@ static int v2_check_quota_file(struct super_block *sb, int type)
  
        size = sb->s_op->quota_read(sb, type, (char *)&dqhead, sizeof(struct v2_disk_dqheader), 0);
        if (size != sizeof(struct v2_disk_dqheader)) {
-               printk("failed read\n");
+               printk("quota_v2: failed read expected=%zd got=%zd\n",
+                       sizeof(struct v2_disk_dqheader), size);
                return 0;
        }
        if (le32_to_cpu(dqhead.dqh_magic) != quota_magics[type] ||
@@ -58,6 +59,9 @@ static int v2_read_file_info(struct super_block *sb, int type)
                        sb->s_id);
                return -1;
        }
+       /* limits are stored as unsigned 32-bit data */
+       info->dqi_maxblimit = 0xffffffff;
+       info->dqi_maxilimit = 0xffffffff;
        info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace);
        info->dqi_igrace = le32_to_cpu(dinfo.dqi_igrace);
        info->dqi_flags = le32_to_cpu(dinfo.dqi_flags);
@@ -393,7 +397,7 @@ static int v2_write_dquot(struct dquot *dquot)
        ssize_t ret;
        struct v2_disk_dqblk ddquot, empty;
 
-       /* dq_off is guarded by dqio_sem */
+       /* dq_off is guarded by dqio_mutex */
        if (!dquot->dq_off)
                if ((ret = dq_insert_tree(dquot)) < 0) {
                        printk(KERN_ERR "VFS: Error %zd occurred while creating quota.\n", ret);
@@ -503,7 +507,8 @@ static int remove_tree(struct dquot *dquot, uint *blk, int depth)
                int i;
                ref[GETIDINDEX(dquot->dq_id, depth)] = cpu_to_le32(0);
                for (i = 0; i < V2_DQBLKSIZE && !buf[i]; i++);  /* Block got empty? */
-               if (i == V2_DQBLKSIZE) {
+               /* Don't put the root block into the free block list */
+               if (i == V2_DQBLKSIZE && *blk != V2_DQTREEOFF) {
                        put_free_dqblk(sb, type, buf, *blk);
                        *blk = 0;
                }