* [PATCH] ext4: do less extent validations
@ 2009-03-12 15:32 Thiemo Nagel
2009-03-16 19:05 ` Thiemo Nagel
2009-03-27 20:53 ` Theodore Tso
0 siblings, 2 replies; 4+ messages in thread
From: Thiemo Nagel @ 2009-03-12 15:32 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: Ext4 Developers List, Aneesh Kumar K.V
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
Based on 2.6.29-rc7 with Aneesh Kumar's patches:
ext4: Validate extent details only when read from the disk
ext4: Add checks to validate extent entries
Sets need_to_validate=0 inside instead of outside the loop.
Signed-off-by: Thiemo Nagel <thiemo.nagel@ph.tum.de>
[-- Attachment #2: less-extent-validations.patch --]
[-- Type: text/x-patch, Size: 618 bytes --]
--- linux-2.6.29-rc7/fs/ext4/extents.c~ 2009-03-12 14:51:21.000000000 +0100
+++ linux-2.6.29-rc7/fs/ext4/extents.c 2009-03-12 16:23:41.000000000 +0100
@@ -607,7 +607,6 @@
ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block,
struct ext4_ext_path *path)
{
- int need_to_validate = 0;
struct ext4_extent_header *eh;
struct buffer_head *bh;
short int depth, i, ppos = 0, alloc = 0;
@@ -629,6 +628,7 @@
i = depth;
/* walk through the tree */
while (i) {
+ int need_to_validate = 0;
ext_debug("depth %d: num %d, max %d\n",
ppos, le16_to_cpu(eh->eh_entries), le16_to_cpu(eh->eh_max));
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ext4: do less extent validations
2009-03-12 15:32 [PATCH] ext4: do less extent validations Thiemo Nagel
@ 2009-03-16 19:05 ` Thiemo Nagel
2009-03-27 20:54 ` Theodore Tso
2009-03-27 20:53 ` Theodore Tso
1 sibling, 1 reply; 4+ messages in thread
From: Thiemo Nagel @ 2009-03-16 19:05 UTC (permalink / raw)
To: Theodore Ts'o, Aneesh Kumar K.V; +Cc: Ext4 Developers List
[-- Attachment #1: Type: text/plain, Size: 845 bytes --]
Thiemo Nagel wrote:
>
> Based on 2.6.29-rc7 with Aneesh Kumar's patches:
> ext4: Validate extent details only when read from the disk
> ext4: Add checks to validate extent entries
>
> Sets need_to_validate=0 inside instead of outside the loop.
OTOH, why not remove the variable altogether? (cf. attached patch)
Kind regards,
Signed-off-by: Thiemo Nagel <thiemo.nagel@ph.tum.de>
--
+-----------------------------------+--------------------------+
| Dipl.-Phys. Thiemo Nagel | |
| Technische Universitaet Muenchen | Room PH1 3276 |
| Physik-Department E18 | |
| James-Franck-Strasse | Phone +49 89 289-12379 |
| D-85747 Garching | Fax +49 89 289-12570 |
+-----------------------------------+--------------------------+
[-- Attachment #2: less-extent-validations.patch2 --]
[-- Type: text/plain, Size: 688 bytes --]
--- linux-2.6.29-rc8/fs/ext4/extents.c~ 2009-03-16 19:37:22.000000000 +0100
+++ linux-2.6.29-rc8/fs/ext4/extents.c 2009-03-16 19:50:33.000000000 +0100
@@ -607,7 +607,6 @@
ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block,
struct ext4_ext_path *path)
{
- int need_to_validate = 0;
struct ext4_extent_header *eh;
struct buffer_head *bh;
short int depth, i, ppos = 0, alloc = 0;
@@ -646,17 +645,16 @@
goto err;
}
/* validate the extent entries */
- need_to_validate = 1;
+ if (ext4_ext_check(inode, eh, i))
+ goto err;
}
+
eh = ext_block_hdr(bh);
ppos++;
BUG_ON(ppos > depth);
path[ppos].p_bh = bh;
path[ppos].p_hdr = eh;
i--;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ext4: do less extent validations
2009-03-12 15:32 [PATCH] ext4: do less extent validations Thiemo Nagel
2009-03-16 19:05 ` Thiemo Nagel
@ 2009-03-27 20:53 ` Theodore Tso
1 sibling, 0 replies; 4+ messages in thread
From: Theodore Tso @ 2009-03-27 20:53 UTC (permalink / raw)
To: Thiemo Nagel; +Cc: Ext4 Developers List, Aneesh Kumar K.V
On Thu, Mar 12, 2009 at 04:32:54PM +0100, Thiemo Nagel wrote:
>
> Based on 2.6.29-rc7 with Aneesh Kumar's patches:
> ext4: Validate extent details only when read from the disk
> ext4: Add checks to validate extent entries
>
> Sets need_to_validate=0 inside instead of outside the loop.
I've integrated this change into Aneesh's patch in the ext4 patch
queue.
- Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ext4: do less extent validations
2009-03-16 19:05 ` Thiemo Nagel
@ 2009-03-27 20:54 ` Theodore Tso
0 siblings, 0 replies; 4+ messages in thread
From: Theodore Tso @ 2009-03-27 20:54 UTC (permalink / raw)
To: Thiemo Nagel; +Cc: Aneesh Kumar K.V, Ext4 Developers List
On Mon, Mar 16, 2009 at 08:05:30PM +0100, Thiemo Nagel wrote:
> Thiemo Nagel wrote:
>>
>> Based on 2.6.29-rc7 with Aneesh Kumar's patches:
>> ext4: Validate extent details only when read from the disk
>> ext4: Add checks to validate extent entries
>>
>> Sets need_to_validate=0 inside instead of outside the loop.
>
> OTOH, why not remove the variable altogether? (cf. attached patch)
This patch causes ext4_ext_check to be called before the variables eh
is set, and before variable is updated.
- Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-03-27 20:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-12 15:32 [PATCH] ext4: do less extent validations Thiemo Nagel
2009-03-16 19:05 ` Thiemo Nagel
2009-03-27 20:54 ` Theodore Tso
2009-03-27 20:53 ` Theodore Tso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).