[parted-devel] [PATCH] libparted: add nilfs2 module

Jim Meyering jim at meyering.net
Mon Mar 7 15:36:00 UTC 2011


Jim Meyering wrote:

> Petr Uzel wrote:
>> On Sat, Mar 05, 2011 at 07:50:04PM +0100, Jim Meyering wrote:
>>> Jiro SEKIBA wrote:
>>>
>>> > Hi,
>>> >
>>> > This is a new fs module to provide following:
>>> > - probe nilfs2 filesystem partition
>>> > - clobber nilfs2 filesystem partition
>>> >
>>
>> .... snip ....
>>
>>> +
>>> +#ifndef DISCOVER_ONLY
>>> +static int
>>> +nilfs2_clobber (PedGeometry* geom)
>>> +{
>>> +	char buf[512];
>>> +	int ret[2];
>>> +
>>> +	memset (buf, 0, 512);
>>> +
>>> +	ret[0] = ped_geometry_write (geom, buf, NILFS_SB_OFFSET, 1);
>>> +	ret[1] = ped_geometry_write (geom, buf,
>>> +				     NILFS_SB2_OFFSET(geom->length), 1);
>>> +
>>> +	return ret[0]|ret[1];
>>> +}
>
> Hello Jiro,
>
> I noticed this comment in nilf2s.c:
>
>     /* primary superblock offset in 512bytes blocks. */
>     #define NILFS_SB_OFFSET			2
>
> That implies that we'd need a different offset for a sector size larger than 512.
> Would you please update nilfs2.c so that it does not put garbage from the
> stack into the two sectors (2nd and secondary) it writes?
>
> Please use libparted/fs/ext2/interface.c's _ext2_clobber function as a model.

I've just remembered that this type of clobber function doesn't really
matter anymore (since Nov 2009's commit
http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=376b14304547d8),
since it is only called when parted is performing one of its deprecated file
system operations.

Hence, there is no need to fix it.
However, I see this as yet another incentive to
remove Parted's file system support altogether.



More information about the parted-devel mailing list