get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1279/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1279,
    "url": "http://patchwork.ozlabs.org/api/patches/1279/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/1222259922.3511.6.camel@frecb007923.frec.bull.fr/",
    "project": {
        "id": 8,
        "url": "http://patchwork.ozlabs.org/api/projects/8/?format=api",
        "name": "Linux ext4 filesystem development",
        "link_name": "linux-ext4",
        "list_id": "linux-ext4.vger.kernel.org",
        "list_email": "linux-ext4@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1222259922.3511.6.camel@frecb007923.frec.bull.fr>",
    "list_archive_url": null,
    "date": "2008-09-24T12:38:42",
    "name": "[v2] ext4: fix initialization of UNINIT bitmap blocks",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "7c3ad93ad94ac0b89e7127508cfd3c075a42fc87",
    "submitter": {
        "id": 486,
        "url": "http://patchwork.ozlabs.org/api/people/486/?format=api",
        "name": "Frédéric Bohé",
        "email": "frederic.bohe@bull.net"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/1222259922.3511.6.camel@frecb007923.frec.bull.fr/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/1279/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1279/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-ext4-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.176.167])\n\tby ozlabs.org (Postfix) with ESMTP id 4C068DDF27\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 24 Sep 2008 22:38:16 +1000 (EST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751538AbYIXMiN (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 24 Sep 2008 08:38:13 -0400",
            "(majordomo@vger.kernel.org) by vger.kernel.org id S1751517AbYIXMiN\n\t(ORCPT <rfc822;linux-ext4-outgoing>);\n\tWed, 24 Sep 2008 08:38:13 -0400",
            "from ecfrec.frec.bull.fr ([129.183.4.8]:37831 \"EHLO\n\tecfrec.frec.bull.fr\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751151AbYIXMiM (ORCPT\n\t<rfc822; linux-ext4@vger.kernel.org>); Wed, 24 Sep 2008 08:38:12 -0400",
            "from localhost (localhost [127.0.0.1])\n\tby ecfrec.frec.bull.fr (Postfix) with ESMTP\n\tid ACC541A18F4; Wed, 24 Sep 2008 14:38:05 +0200 (CEST)",
            "from ecfrec.frec.bull.fr ([127.0.0.1])\n\tby localhost (ecfrec.frec.bull.fr [127.0.0.1]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id 30959-08; Wed, 24 Sep 2008 14:38:02 +0200 (CEST)",
            "from cyclope.frec.bull.fr (cyclope.frec.bull.fr [129.183.4.9])\n\tby ecfrec.frec.bull.fr (Postfix) with ESMTP\n\tid 735161A194B; Wed, 24 Sep 2008 14:37:10 +0200 (CEST)",
            "from [129.183.101.223] (dhcp129183101223.frec.bull.fr\n\t[129.183.101.223])\n\tby cyclope.frec.bull.fr (Postfix) with ESMTP id 7190E2728D;\n\tWed, 24 Sep 2008 14:37:07 +0200 (CEST)"
        ],
        "Subject": "Re: [PATCH v2] ext4: fix initialization of UNINIT bitmap blocks",
        "From": "=?ISO-8859-1?Q?Fr=E9d=E9ric_Boh=E9?= <frederic.bohe@bull.net>",
        "To": "\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>,\n\tTheodore Tso <tytso@mit.edu>",
        "Cc": "\"linux-ext4@vger.kernel.org\" <linux-ext4@vger.kernel.org>",
        "In-Reply-To": "<1222075960.3581.33.camel@frecb007923.frec.bull.fr>",
        "References": "<1221478895.6733.26.camel@frecb007923.frec.bull.fr>\n\t<1221481007.6733.32.camel@frecb007923.frec.bull.fr>\n\t<20080915133604.GA6548@skywalker>\n\t<1221489026.6733.36.camel@frecb007923.frec.bull.fr>\n\t<1221745514.3550.83.camel@frecb007923.frec.bull.fr>\n\t<20080921004451.GA15402@mit.edu>\n\t<1222070998.3581.25.camel@frecb007923.frec.bull.fr>\n\t<20080922084721.GA6691@skywalker>\n\t<1222075960.3581.33.camel@frecb007923.frec.bull.fr>",
        "Content-Type": "text/plain; charset=UTF-8",
        "Organization": "Bull",
        "Date": "Wed, 24 Sep 2008 14:38:42 +0200",
        "Message-Id": "<1222259922.3511.6.camel@frecb007923.frec.bull.fr>",
        "Mime-Version": "1.0",
        "X-Mailer": "Evolution 2.22.3.1 ",
        "Content-Transfer-Encoding": "8bit",
        "X-Virus-Scanned": "by amavisd-new at frec.bull.fr",
        "Sender": "linux-ext4-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<linux-ext4.vger.kernel.org>",
        "X-Mailing-List": "linux-ext4@vger.kernel.org"
    },
    "content": "Le lundi 22 septembre 2008 à 11:32 +0200, Frédéric Bohé a écrit :\n> Le lundi 22 septembre 2008 à 14:17 +0530, Aneesh Kumar K.V a écrit :\n> > What you can do is make ext4_group_info generic for both mballoc and\n> > oldalloc. We can then add bg_flag to the in memory ext4_group_info\n> > that would indicate whether the group is initialized or not. Here\n> > initialized for an UNINIT_GROUP indicate we have done\n> > ext4_init_block_bitmap on the buffer_head. Then \n> > instead of depending on the buffer_head uptodate flag we can check\n> > for the ext4_group_info bg_flags and decided whether the block/inode\n> > bitmap need to be initialized.\n> > \n> \n> That makes sense ! I agree with you, we need an additional in-memory\n> flag to know whether buffers are initialized or not. Anyway, making\n> ext4_group_info generic will lead to unneeded memory consumption for\n> oldalloc. Maybe a simple independent bits array could do the trick. Is\n> there any advantage to re-use ext4_group_info ?\n> \n\nThis is an implementation of what I was talking about. Please let me know your comments.\n\n\n \n\n\n--\nTo unsubscribe from this list: send the line \"unsubscribe linux-ext4\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html",
    "diff": "Index: linux-2.6.27-rc6+patch_queue/fs/ext4/balloc.c\n===================================================================\n--- linux-2.6.27-rc6+patch_queue.orig/fs/ext4/balloc.c\t2008-09-23 15:04:39.000000000 +0200\n+++ linux-2.6.27-rc6+patch_queue/fs/ext4/balloc.c\t2008-09-23 15:39:38.000000000 +0200\n@@ -175,6 +175,8 @@ unsigned ext4_init_block_bitmap(struct s\n \t\t */\n \t\tmark_bitmap_end(group_blocks, sb->s_blocksize * 8, bh->b_data);\n \t}\n+\n+\text4_set_bit(block_group, sbi->s_block_bitmap_buffer_state);\n \treturn free_blocks - ext4_group_used_meta_blocks(sb, block_group);\n }\n \n@@ -318,9 +320,13 @@ ext4_read_block_bitmap(struct super_bloc\n \t\t\t    block_group, bitmap_blk);\n \t\treturn NULL;\n \t}\n-\tif (bh_uptodate_or_lock(bh))\n+\n+\tif (buffer_uptodate(bh) && ext4_test_bit(block_group,\n+\t\t\t\tEXT4_SB(sb)->s_block_bitmap_buffer_state))\n \t\treturn bh;\n \n+\tlock_buffer(bh);\n+\n \tspin_lock(sb_bgl_lock(EXT4_SB(sb), block_group));\n \tif (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {\n \t\text4_init_block_bitmap(sb, bh, block_group, desc);\n@@ -328,7 +334,9 @@ ext4_read_block_bitmap(struct super_bloc\n \t\tunlock_buffer(bh);\n \t\tspin_unlock(sb_bgl_lock(EXT4_SB(sb), block_group));\n \t\treturn bh;\n-\t}\n+\t} else\n+\t\text4_set_bit(block_group,\n+\t\t\t      EXT4_SB(sb)->s_block_bitmap_buffer_state);\n \tspin_unlock(sb_bgl_lock(EXT4_SB(sb), block_group));\n \tif (bh_submit_read(bh) < 0) {\n \t\tput_bh(bh);\nIndex: linux-2.6.27-rc6+patch_queue/fs/ext4/ext4_sb.h\n===================================================================\n--- linux-2.6.27-rc6+patch_queue.orig/fs/ext4/ext4_sb.h\t2008-09-23 15:07:28.000000000 +0200\n+++ linux-2.6.27-rc6+patch_queue/fs/ext4/ext4_sb.h\t2008-09-23 15:40:57.000000000 +0200\n@@ -147,6 +147,14 @@ struct ext4_sb_info {\n \n \tunsigned int s_log_groups_per_flex;\n \tstruct flex_groups *s_flex_groups;\n+\n+\t/*\n+\t * Flag for the state of the bitmaps buffers\n+\t * 0 = unknown or uninitialized\n+\t * 1 = initialized\n+\t */\n+\tchar *s_block_bitmap_buffer_state;\n+\tchar *s_inode_bitmap_buffer_state;\n };\n \n #endif\t/* _EXT4_SB */\nIndex: linux-2.6.27-rc6+patch_queue/fs/ext4/ialloc.c\n===================================================================\n--- linux-2.6.27-rc6+patch_queue.orig/fs/ext4/ialloc.c\t2008-09-23 15:09:15.000000000 +0200\n+++ linux-2.6.27-rc6+patch_queue/fs/ext4/ialloc.c\t2008-09-23 15:41:24.000000000 +0200\n@@ -86,6 +86,7 @@ unsigned ext4_init_inode_bitmap(struct s\n \tmemset(bh->b_data, 0, (EXT4_INODES_PER_GROUP(sb) + 7) / 8);\n \tmark_bitmap_end(EXT4_INODES_PER_GROUP(sb), EXT4_BLOCKS_PER_GROUP(sb),\n \t\t\tbh->b_data);\n+\text4_set_bit(block_group, sbi->s_inode_bitmap_buffer_state);\n \n \treturn EXT4_INODES_PER_GROUP(sb);\n }\n@@ -115,9 +116,12 @@ ext4_read_inode_bitmap(struct super_bloc\n \t\t\t    block_group, bitmap_blk);\n \t\treturn NULL;\n \t}\n-\tif (bh_uptodate_or_lock(bh))\n+\n+\tif (buffer_uptodate(bh) && ext4_test_bit(block_group,\n+\t\t\t\tEXT4_SB(sb)->s_inode_bitmap_buffer_state))\n \t\treturn bh;\n \n+\tlock_buffer(bh);\n \tspin_lock(sb_bgl_lock(EXT4_SB(sb), block_group));\n \tif (desc->bg_flags & cpu_to_le16(EXT4_BG_INODE_UNINIT)) {\n \t\text4_init_inode_bitmap(sb, bh, block_group, desc);\n@@ -125,7 +129,9 @@ ext4_read_inode_bitmap(struct super_bloc\n \t\tunlock_buffer(bh);\n \t\tspin_unlock(sb_bgl_lock(EXT4_SB(sb), block_group));\n \t\treturn bh;\n-\t}\n+\t} else\n+\t\text4_set_bit(block_group,\n+\t\t\t\tEXT4_SB(sb)->s_inode_bitmap_buffer_state);\n \tspin_unlock(sb_bgl_lock(EXT4_SB(sb), block_group));\n \tif (bh_submit_read(bh) < 0) {\n \t\tput_bh(bh);\nIndex: linux-2.6.27-rc6+patch_queue/fs/ext4/mballoc.c\n===================================================================\n--- linux-2.6.27-rc6+patch_queue.orig/fs/ext4/mballoc.c\t2008-09-23 15:11:48.000000000 +0200\n+++ linux-2.6.27-rc6+patch_queue/fs/ext4/mballoc.c\t2008-09-24 14:27:55.000000000 +0200\n@@ -785,9 +785,12 @@ static int ext4_mb_init_cache(struct pag\n \t\tif (bh[i] == NULL)\n \t\t\tgoto out;\n \n-\t\tif (bh_uptodate_or_lock(bh[i]))\n+\t\tif (buffer_uptodate(bh[i]) && ext4_test_bit(first_group + i,\n+\t\t\t\tEXT4_SB(sb)->s_block_bitmap_buffer_state))\n \t\t\tcontinue;\n \n+\t\tlock_buffer(bh[i]);\n+\n \t\tspin_lock(sb_bgl_lock(EXT4_SB(sb), first_group + i));\n \t\tif (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {\n \t\t\text4_init_block_bitmap(sb, bh[i],\n@@ -796,7 +799,9 @@ static int ext4_mb_init_cache(struct pag\n \t\t\tunlock_buffer(bh[i]);\n \t\t\tspin_unlock(sb_bgl_lock(EXT4_SB(sb), first_group + i));\n \t\t\tcontinue;\n-\t\t}\n+\t\t} else\n+\t\t\text4_set_bit(first_group + i,\n+\t\t\t\tEXT4_SB(sb)->s_block_bitmap_buffer_state);\n \t\tspin_unlock(sb_bgl_lock(EXT4_SB(sb), first_group + i));\n \t\tget_bh(bh[i]);\n \t\tbh[i]->b_end_io = end_buffer_read_sync;\nIndex: linux-2.6.27-rc6+patch_queue/fs/ext4/super.c\n===================================================================\n--- linux-2.6.27-rc6+patch_queue.orig/fs/ext4/super.c\t2008-09-23 15:16:15.000000000 +0200\n+++ linux-2.6.27-rc6+patch_queue/fs/ext4/super.c\t2008-09-24 14:28:42.000000000 +0200\n@@ -2219,6 +2219,20 @@ static int ext4_fill_super(struct super_\n \t\tprintk(KERN_ERR \"EXT4-fs: not enough memory\\n\");\n \t\tgoto failed_mount;\n \t}\n+\tsbi->s_block_bitmap_buffer_state = kzalloc((sbi->s_groups_count +\n+\t\t\t\t    le16_to_cpu(es->s_reserved_gdt_blocks) +\n+\t\t\t\t    7) / 8, GFP_KERNEL);\n+\tif (sbi->s_block_bitmap_buffer_state == NULL) {\n+\t\tprintk(KERN_ERR \"EXT4-fs: not enough memory\\n\");\n+\t\tgoto failed_mount;\n+\t}\n+\tsbi->s_inode_bitmap_buffer_state = kzalloc((sbi->s_groups_count +\n+\t\t\t\t    le16_to_cpu(es->s_reserved_gdt_blocks) +\n+\t\t\t\t    7) / 8, GFP_KERNEL);\n+\tif (sbi->s_inode_bitmap_buffer_state == NULL) {\n+\t\tprintk(KERN_ERR \"EXT4-fs: not enough memory\\n\");\n+\t\tgoto failed_mount;\n+\t}\n \n \tbgl_lock_init(&sbi->s_blockgroup_lock);\n \n",
    "prefixes": [
        "v2"
    ]
}