* [PATCH] fix calculation of 2nd superblock position.
@ 2010-07-07 11:39 Jiro SEKIBA
2010-07-12 23:12 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 5+ messages in thread
From: Jiro SEKIBA @ 2010-07-07 11:39 UTC (permalink / raw)
To: grub-devel
Hi,
This patch fixes calculation of 2nd superblock position.
nilfs2 has two super blocks, the 1st one is at beginning of the partition,
the 2nd one is the end of partition. 2nd one resides at last 4k block.
However when the partition size is not a multiple of 4k bytes, the
remainder will be ignored.
2010-07-07 Jiro SEKIBA <jir@unicus.jp>
* fs/nilfs2.c: fix macro NILFS_2ND_SUPER_BLOCK to calculate
2nd superblock position from partition size.
=== modified file 'fs/nilfs2.c'
--- fs/nilfs2.c 2010-05-31 18:49:42 +0000
+++ fs/nilfs2.c 2010-07-07 10:58:13 +0000
@@ -52,9 +52,9 @@
/* nilfs 1st super block posission from beginning of the partition
in 512 block size */
#define NILFS_1ST_SUPER_BLOCK 2
-/* nilfs 2nd super block posission from end of the partition
+/* nilfs 2nd super block posission from beginning of the partition
in 512 block size */
-#define NILFS_2ND_SUPER_BLOCK 8
+#define NILFS_2ND_SUPER_BLOCK(devsize) (((devsize >> 3) - 1) << 3)
struct grub_nilfs2_inode
{
@@ -729,7 +729,7 @@
if (partition_size != GRUB_DISK_SIZE_UNKNOWN)
{
/* Read second super block. */
- grub_disk_read (disk, partition_size - NILFS_2ND_SUPER_BLOCK, 0,
+ grub_disk_read (disk, NILFS_2ND_SUPER_BLOCK (partition_size), 0,
sizeof (struct grub_nilfs2_super_block), &sb2);
/* Make sure if 2nd super block is valid. */
valid[1] = grub_nilfs2_valid_sb (&sb2);
--
Jiro SEKIBA <jir@unicus.jp>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fix calculation of 2nd superblock position.
2010-07-07 11:39 [PATCH] fix calculation of 2nd superblock position Jiro SEKIBA
@ 2010-07-12 23:12 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-13 2:08 ` Jiro SEKIBA
0 siblings, 1 reply; 5+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-07-12 23:12 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1679 bytes --]
On 07/07/2010 01:39 PM, Jiro SEKIBA wrote:
> Hi,
>
> This patch fixes calculation of 2nd superblock position.
>
> nilfs2 has two super blocks, the 1st one is at beginning of the partition,
> the 2nd one is the end of partition. 2nd one resides at last 4k block.
> However when the partition size is not a multiple of 4k bytes, the
> remainder will be ignored.
>
> 2010-07-07 Jiro SEKIBA <jir@unicus.jp>
>
> * fs/nilfs2.c: fix macro NILFS_2ND_SUPER_BLOCK to calculate
> 2nd superblock position from partition size.
>
>
Go ahead for trunk
> === modified file 'fs/nilfs2.c'
> --- fs/nilfs2.c 2010-05-31 18:49:42 +0000
> +++ fs/nilfs2.c 2010-07-07 10:58:13 +0000
> @@ -52,9 +52,9 @@
> /* nilfs 1st super block posission from beginning of the partition
> in 512 block size */
> #define NILFS_1ST_SUPER_BLOCK 2
> -/* nilfs 2nd super block posission from end of the partition
> +/* nilfs 2nd super block posission from beginning of the partition
> in 512 block size */
> -#define NILFS_2ND_SUPER_BLOCK 8
> +#define NILFS_2ND_SUPER_BLOCK(devsize) (((devsize >> 3) - 1) << 3)
>
> struct grub_nilfs2_inode
> {
> @@ -729,7 +729,7 @@
> if (partition_size != GRUB_DISK_SIZE_UNKNOWN)
> {
> /* Read second super block. */
> - grub_disk_read (disk, partition_size - NILFS_2ND_SUPER_BLOCK, 0,
> + grub_disk_read (disk, NILFS_2ND_SUPER_BLOCK (partition_size), 0,
> sizeof (struct grub_nilfs2_super_block), &sb2);
> /* Make sure if 2nd super block is valid. */
> valid[1] = grub_nilfs2_valid_sb (&sb2);
>
>
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fix calculation of 2nd superblock position.
2010-07-12 23:12 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-13 2:08 ` Jiro SEKIBA
2010-07-13 9:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 5+ messages in thread
From: Jiro SEKIBA @ 2010-07-13 2:08 UTC (permalink / raw)
To: The development of GNU GRUB
At Tue, 13 Jul 2010 01:12:05 +0200,
Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>
> [1 <multipart/signed (7bit)>]
> [1.1 <text/plain; UTF-8 (quoted-printable)>]
> On 07/07/2010 01:39 PM, Jiro SEKIBA wrote:
> > Hi,
> >
> > This patch fixes calculation of 2nd superblock position.
> >
> > nilfs2 has two super blocks, the 1st one is at beginning of the partition,
> > the 2nd one is the end of partition. 2nd one resides at last 4k block.
> > However when the partition size is not a multiple of 4k bytes, the
> > remainder will be ignored.
> >
> > 2010-07-07 Jiro SEKIBA <jir@unicus.jp>
> >
> > * fs/nilfs2.c: fix macro NILFS_2ND_SUPER_BLOCK to calculate
> > 2nd superblock position from partition size.
> >
> >
> Go ahead for trunk
Sorry, but what am I supposed to do?
Did I have a write access to the trunk?
> > === modified file 'fs/nilfs2.c'
> > --- fs/nilfs2.c 2010-05-31 18:49:42 +0000
> > +++ fs/nilfs2.c 2010-07-07 10:58:13 +0000
> > @@ -52,9 +52,9 @@
> > /* nilfs 1st super block posission from beginning of the partition
> > in 512 block size */
> > #define NILFS_1ST_SUPER_BLOCK 2
> > -/* nilfs 2nd super block posission from end of the partition
> > +/* nilfs 2nd super block posission from beginning of the partition
> > in 512 block size */
> > -#define NILFS_2ND_SUPER_BLOCK 8
> > +#define NILFS_2ND_SUPER_BLOCK(devsize) (((devsize >> 3) - 1) << 3)
> >
> > struct grub_nilfs2_inode
> > {
> > @@ -729,7 +729,7 @@
> > if (partition_size != GRUB_DISK_SIZE_UNKNOWN)
> > {
> > /* Read second super block. */
> > - grub_disk_read (disk, partition_size - NILFS_2ND_SUPER_BLOCK, 0,
> > + grub_disk_read (disk, NILFS_2ND_SUPER_BLOCK (partition_size), 0,
> > sizeof (struct grub_nilfs2_super_block), &sb2);
> > /* Make sure if 2nd super block is valid. */
> > valid[1] = grub_nilfs2_valid_sb (&sb2);
> >
> >
> >
>
>
> --
> Regards
> Vladimir 'φ-coder/phcoder' Serbinenko
>
>
> [1.2 OpenPGP digital signature <application/pgp-signature (7bit)>]
>
> [2 <text/plain; us-ascii (7bit)>]
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
--
Jiro SEKIBA <jir@unicus.jp>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fix calculation of 2nd superblock position.
2010-07-13 2:08 ` Jiro SEKIBA
@ 2010-07-13 9:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-13 9:59 ` Jiro SEKIBA
0 siblings, 1 reply; 5+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-07-13 9:48 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 2586 bytes --]
On 07/13/2010 04:08 AM, Jiro SEKIBA wrote:
> At Tue, 13 Jul 2010 01:12:05 +0200,
> Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>
>> [1 <multipart/signed (7bit)>]
>> [1.1 <text/plain; UTF-8 (quoted-printable)>]
>> On 07/07/2010 01:39 PM, Jiro SEKIBA wrote:
>>
>>> Hi,
>>>
>>> This patch fixes calculation of 2nd superblock position.
>>>
>>> nilfs2 has two super blocks, the 1st one is at beginning of the partition,
>>> the 2nd one is the end of partition. 2nd one resides at last 4k block.
>>> However when the partition size is not a multiple of 4k bytes, the
>>> remainder will be ignored.
>>>
>>> 2010-07-07 Jiro SEKIBA <jir@unicus.jp>
>>>
>>> * fs/nilfs2.c: fix macro NILFS_2ND_SUPER_BLOCK to calculate
>>> 2nd superblock position from partition size.
>>>
>>>
>>>
>> Go ahead for trunk
>>
> Sorry, but what am I supposed to do?
> Did I have a write access to the trunk?
>
>
No, I plainly forgot to give you one. What's your savannah account?
I committed your patch.
>>> === modified file 'fs/nilfs2.c'
>>> --- fs/nilfs2.c 2010-05-31 18:49:42 +0000
>>> +++ fs/nilfs2.c 2010-07-07 10:58:13 +0000
>>> @@ -52,9 +52,9 @@
>>> /* nilfs 1st super block posission from beginning of the partition
>>> in 512 block size */
>>> #define NILFS_1ST_SUPER_BLOCK 2
>>> -/* nilfs 2nd super block posission from end of the partition
>>> +/* nilfs 2nd super block posission from beginning of the partition
>>> in 512 block size */
>>> -#define NILFS_2ND_SUPER_BLOCK 8
>>> +#define NILFS_2ND_SUPER_BLOCK(devsize) (((devsize >> 3) - 1) << 3)
>>>
>>> struct grub_nilfs2_inode
>>> {
>>> @@ -729,7 +729,7 @@
>>> if (partition_size != GRUB_DISK_SIZE_UNKNOWN)
>>> {
>>> /* Read second super block. */
>>> - grub_disk_read (disk, partition_size - NILFS_2ND_SUPER_BLOCK, 0,
>>> + grub_disk_read (disk, NILFS_2ND_SUPER_BLOCK (partition_size), 0,
>>> sizeof (struct grub_nilfs2_super_block), &sb2);
>>> /* Make sure if 2nd super block is valid. */
>>> valid[1] = grub_nilfs2_valid_sb (&sb2);
>>>
>>>
>>>
>>>
>>
>> --
>> Regards
>> Vladimir 'φ-coder/phcoder' Serbinenko
>>
>>
>> [1.2 OpenPGP digital signature <application/pgp-signature (7bit)>]
>>
>> [2 <text/plain; us-ascii (7bit)>]
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> http://lists.gnu.org/mailman/listinfo/grub-devel
>>
>
>
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fix calculation of 2nd superblock position.
2010-07-13 9:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-07-13 9:59 ` Jiro SEKIBA
0 siblings, 0 replies; 5+ messages in thread
From: Jiro SEKIBA @ 2010-07-13 9:59 UTC (permalink / raw)
To: The development of GNU GRUB
At Tue, 13 Jul 2010 11:48:15 +0200,
Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>
> On 07/13/2010 04:08 AM, Jiro SEKIBA wrote:
> > At Tue, 13 Jul 2010 01:12:05 +0200,
> > Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> >
> >> [1 <multipart/signed (7bit)>]
> >> [1.1 <text/plain; UTF-8 (quoted-printable)>]
> >> On 07/07/2010 01:39 PM, Jiro SEKIBA wrote:
> >>
> >>> Hi,
> >>>
> >>> This patch fixes calculation of 2nd superblock position.
> >>>
> >>> nilfs2 has two super blocks, the 1st one is at beginning of the partition,
> >>> the 2nd one is the end of partition. 2nd one resides at last 4k block.
> >>> However when the partition size is not a multiple of 4k bytes, the
> >>> remainder will be ignored.
> >>>
> >>> 2010-07-07 Jiro SEKIBA <jir@unicus.jp>
> >>>
> >>> * fs/nilfs2.c: fix macro NILFS_2ND_SUPER_BLOCK to calculate
> >>> 2nd superblock position from partition size.
> >>>
> >>>
> >>>
> >> Go ahead for trunk
> >>
> > Sorry, but what am I supposed to do?
> > Did I have a write access to the trunk?
> >
> >
> No, I plainly forgot to give you one. What's your savannah account?
> I committed your patch.
Thanks,
I obtained one. My account is "jir".
> >>> === modified file 'fs/nilfs2.c'
> >>> --- fs/nilfs2.c 2010-05-31 18:49:42 +0000
> >>> +++ fs/nilfs2.c 2010-07-07 10:58:13 +0000
> >>> @@ -52,9 +52,9 @@
> >>> /* nilfs 1st super block posission from beginning of the partition
> >>> in 512 block size */
> >>> #define NILFS_1ST_SUPER_BLOCK 2
> >>> -/* nilfs 2nd super block posission from end of the partition
> >>> +/* nilfs 2nd super block posission from beginning of the partition
> >>> in 512 block size */
> >>> -#define NILFS_2ND_SUPER_BLOCK 8
> >>> +#define NILFS_2ND_SUPER_BLOCK(devsize) (((devsize >> 3) - 1) << 3)
> >>>
> >>> struct grub_nilfs2_inode
> >>> {
> >>> @@ -729,7 +729,7 @@
> >>> if (partition_size != GRUB_DISK_SIZE_UNKNOWN)
> >>> {
> >>> /* Read second super block. */
> >>> - grub_disk_read (disk, partition_size - NILFS_2ND_SUPER_BLOCK, 0,
> >>> + grub_disk_read (disk, NILFS_2ND_SUPER_BLOCK (partition_size), 0,
> >>> sizeof (struct grub_nilfs2_super_block), &sb2);
> >>> /* Make sure if 2nd super block is valid. */
> >>> valid[1] = grub_nilfs2_valid_sb (&sb2);
> >>>
> >>>
> >>>
> >>>
> >>
> >> --
> >> Regards
> >> Vladimir 'φ-coder/phcoder' Serbinenko
> >>
> >>
> >> [1.2 OpenPGP digital signature <application/pgp-signature (7bit)>]
> >>
> >> [2 <text/plain; us-ascii (7bit)>]
> >> _______________________________________________
> >> Grub-devel mailing list
> >> Grub-devel@gnu.org
> >> http://lists.gnu.org/mailman/listinfo/grub-devel
> >>
> >
> >
> >
>
>
> --
> Regards
> Vladimir 'φ-coder/phcoder' Serbinenko
>
>
--
Jiro SEKIBA <jir@unicus.jp>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-07-13 10:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-07 11:39 [PATCH] fix calculation of 2nd superblock position Jiro SEKIBA
2010-07-12 23:12 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-13 2:08 ` Jiro SEKIBA
2010-07-13 9:48 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-07-13 9:59 ` Jiro SEKIBA
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.