[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <20090903052103.GM4197@webber.adilger.int>
Date: Wed, 02 Sep 2009 23:21:03 -0600
From: Andreas Dilger <adilger@....com>
To: Nick Dokos <nicholas.dokos@...com>
Cc: "Theodore Ts'o" <tytso@....edu>, linux-ext4@...r.kernel.org,
Eric Sandeen <sandeen@...hat.com>,
Justin Maggard <jmaggard10@...il.com>,
Ric Wheeler <rwheeler@...hat.com>
Subject: Re: [PATCH] Fix ext2fs_set_gdt_csum() to use access functions.
On Sep 02, 2009 23:21 -0400, Nick Dokos wrote:
> Replace all field accesses with calls to access functions.
> Most importantly, get rid of the mis-declared group descriptor
> pointer which caused the wrong fields to be updated.
>
> errcode_t ext2fs_set_gdt_csum(ext2_filsys fs)
> {
> struct ext2_super_block *sb = fs->super;
> - struct ext2_group_desc *bg = fs->group_desc;
Given the danger of ongoing direct access to fs->group_desc (including
potentially from external applications) I think the only safe way of
doing this is to have an opaque fs->group_desc structure that cannot
be dereferenced outside of the library.
As a potential compatibility measure, we might consider fs->group_desc
to be valid for 32-bit filesystems, and leave it NULL for 64-bit
filesystems and use a second (opaque) fs->group_desc64 pointer for
access to filesystems with INCOMPAT_64BIT set.
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists