* patch for mkfs.ubifs devtable.c increment in dev_table is wrongly interpreted
@ 2009-08-02 14:04 Daniel Neukomm
2009-08-03 3:48 ` Mike Frysinger
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Daniel Neukomm @ 2009-08-02 14:04 UTC (permalink / raw)
To: linux-mtd
patch for mkfs.ubifs devtable.c increment in dev_table is wrongly
interpreted
with the device table one can add /dev entries to the root file system
image.
The device table file contains among others the fields minor, start,
increment and count.
If there is an entry with minor=0 start=0 increment =32 and count=4 the
mkfs.ubifs makes
128 device entries, with minor numbers from 0 to 127
The correct version makes 4 entries with minor number 0,32,64,96.
/dev/mtd c 640 0 0 90 0 0 2 7
This gives 14 devices /dev/mtdXX instead of 7 devices.
Due to this error mtd_debug info /dev/mtd3 delivers the information of
/dev/mtd1 instead of.
diff --git a/mkfs.ubifs/devtable.c b/mkfs.ubifs/devtable.c
index 236a6e7..e2d96dc 100644
--- a/mkfs.ubifs/devtable.c
+++ b/mkfs.ubifs/devtable.c
@@ -248,7 +248,7 @@ static int interpret_table_entry(const char *line)
goto out_free;
}
} else {
- int i, num = start + increment * count, len =
strlen(name) + 20;
+ int i, num = start + count, len = strlen(name) + 20;
char *nm;
for (i = start; i < num; i++) {
@@ -262,7 +262,7 @@ static int interpret_table_entry(const char *line)
nh_elt->mode = mode;
nh_elt->uid = uid;
nh_elt->gid = gid;
- nh_elt->dev = makedev(major, minor + i - start);
+ nh_elt->dev = makedev(major, minor + (i -
start)*increment);
nm = malloc(len);
if (!nm) {
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: patch for mkfs.ubifs devtable.c increment in dev_table is wrongly interpreted
2009-08-02 14:04 patch for mkfs.ubifs devtable.c increment in dev_table is wrongly interpreted Daniel Neukomm
@ 2009-08-03 3:48 ` Mike Frysinger
2009-08-10 7:36 ` Artem Bityutskiy
2009-08-11 6:45 ` Artem Bityutskiy
2 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2009-08-03 3:48 UTC (permalink / raw)
To: Daniel Neukomm; +Cc: linux-mtd
On Sun, Aug 2, 2009 at 10:04, Daniel Neukomm wrote:
> patch for mkfs.ubifs devtable.c increment in dev_table is wrongly
> interpreted
>
> with the device table one can add /dev entries to the root file system
> image.
> The device table file contains among others the fields minor, start,
> increment and count.
> If there is an entry with minor=0 start=0 increment =32 and count=4 the
> mkfs.ubifs makes
> 128 device entries, with minor numbers from 0 to 127
> The correct version makes 4 entries with minor number 0,32,64,96.
>
> /dev/mtd c 640 0 0 90 0 0 2 7
> This gives 14 devices /dev/mtdXX instead of 7 devices.
> Due to this error mtd_debug info /dev/mtd3 delivers the information of
> /dev/mtd1 instead of.
> diff --git a/mkfs.ubifs/devtable.c b/mkfs.ubifs/devtable.c
> index 236a6e7..e2d96dc 100644
all patches should include signed-off-by tags. please read the
Documentation/SubmittingPatches file in the linux kernel source code
for some guidelines.
-mike
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: patch for mkfs.ubifs devtable.c increment in dev_table is wrongly interpreted
2009-08-02 14:04 patch for mkfs.ubifs devtable.c increment in dev_table is wrongly interpreted Daniel Neukomm
2009-08-03 3:48 ` Mike Frysinger
@ 2009-08-10 7:36 ` Artem Bityutskiy
2009-08-11 6:45 ` Artem Bityutskiy
2 siblings, 0 replies; 6+ messages in thread
From: Artem Bityutskiy @ 2009-08-10 7:36 UTC (permalink / raw)
To: Daniel Neukomm; +Cc: linux-mtd
On Sun, 2009-08-02 at 16:04 +0200, Daniel Neukomm wrote:
> patch for mkfs.ubifs devtable.c increment in dev_table is wrongly
> interpreted
>
> with the device table one can add /dev entries to the root file system
> image.
> The device table file contains among others the fields minor, start,
> increment and count.
> If there is an entry with minor=0 start=0 increment =32 and count=4 the
> mkfs.ubifs makes
> 128 device entries, with minor numbers from 0 to 127
> The correct version makes 4 entries with minor number 0,32,64,96.
>
> /dev/mtd c 640 0 0 90 0 0 2 7
> This gives 14 devices /dev/mtdXX instead of 7 devices.
> Due to this error mtd_debug info /dev/mtd3 delivers the information of
> /dev/mtd1 instead of.
>
> diff --git a/mkfs.ubifs/devtable.c b/mkfs.ubifs/devtable.c
> index 236a6e7..e2d96dc 100644
> --- a/mkfs.ubifs/devtable.c
> +++ b/mkfs.ubifs/devtable.c
> @@ -248,7 +248,7 @@ static int interpret_table_entry(const char *line)
> goto out_free;
> }
> } else {
> - int i, num = start + increment * count, len =
> strlen(name) + 20;
> + int i, num = start + count, len = strlen(name) + 20;
> char *nm;
>
> for (i = start; i < num; i++) {
> @@ -262,7 +262,7 @@ static int interpret_table_entry(const char *line)
> nh_elt->mode = mode;
> nh_elt->uid = uid;
> nh_elt->gid = gid;
> - nh_elt->dev = makedev(major, minor + i - start);
> + nh_elt->dev = makedev(major, minor + (i -
> start)*increment);
>
> nm = malloc(len);
> if (!nm) {
Hi,
thanks for the patch. Are you planning to re-send it properly with
no line-wrapping and with signed-off-by?
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: patch for mkfs.ubifs devtable.c increment in dev_table is wrongly interpreted
2009-08-02 14:04 patch for mkfs.ubifs devtable.c increment in dev_table is wrongly interpreted Daniel Neukomm
2009-08-03 3:48 ` Mike Frysinger
2009-08-10 7:36 ` Artem Bityutskiy
@ 2009-08-11 6:45 ` Artem Bityutskiy
2009-08-11 11:21 ` Artem Bityutskiy
2 siblings, 1 reply; 6+ messages in thread
From: Artem Bityutskiy @ 2009-08-11 6:45 UTC (permalink / raw)
To: Daniel Neukomm; +Cc: linux-mtd
On Sun, 2009-08-02 at 16:04 +0200, Daniel Neukomm wrote:
> patch for mkfs.ubifs devtable.c increment in dev_table is wrongly
> interpreted
>
> with the device table one can add /dev entries to the root file system
> image.
> The device table file contains among others the fields minor, start,
> increment and count.
> If there is an entry with minor=0 start=0 increment =32 and count=4 the
> mkfs.ubifs makes
> 128 device entries, with minor numbers from 0 to 127
> The correct version makes 4 entries with minor number 0,32,64,96.
>
> /dev/mtd c 640 0 0 90 0 0 2 7
> This gives 14 devices /dev/mtdXX instead of 7 devices.
> Due to this error mtd_debug info /dev/mtd3 delivers the information of
> /dev/mtd1 instead of.
Ok, below is how you was supposed to send the patch (without my
Signed-off-by, of course). I just applied your patch manually (usually
we use git am for this) and tweaked it.
Please, check that I did not do any mistake. After you have confirmed
this, I'll push this to the mtd-utils repository.
From: Daniel Neukomm <Neukomm@vtxmail.ch>
Subject: [PATCH] mkfs.ubifs: correct devtable increment handling
With the device table one can add /dev entries to the root file system
image. The device table file contains among others the fields minor,
start, increment and count. If there is an entry with minor=0 start=0
increment=32 and count=4 the mkfs.ubifs makes 128 device entries, with
minor numbers from 0 to 127. The correct version makes 4 entries with
minor number 0,32,64,96.
/dev/mtd c 640 0 0 90 0 0 2 7
This gives 14 devices /dev/mtdXX instead of 7 devices.
Due to this error mtd_debug info /dev/mtd3 delivers the information of
/dev/mtd1 instead of.
Signed-off-by: Daniel Neukomm <Neukomm@vtxmail.ch>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
mkfs.ubifs/devtable.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkfs.ubifs/devtable.c b/mkfs.ubifs/devtable.c
index 236a6e7..dee035d 100644
--- a/mkfs.ubifs/devtable.c
+++ b/mkfs.ubifs/devtable.c
@@ -248,7 +248,7 @@ static int interpret_table_entry(const char *line)
goto out_free;
}
} else {
- int i, num = start + increment * count, len = strlen(name) + 20;
+ int i, num = start + count, len = strlen(name) + 20;
char *nm;
for (i = start; i < num; i++) {
@@ -262,7 +262,7 @@ static int interpret_table_entry(const char *line)
nh_elt->mode = mode;
nh_elt->uid = uid;
nh_elt->gid = gid;
- nh_elt->dev = makedev(major, minor + i - start);
+ nh_elt->dev = makedev(major, minor + (i - start) * increment);
nm = malloc(len);
if (!nm) {
--
1.6.0.6
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: patch for mkfs.ubifs devtable.c increment in dev_table is wrongly interpreted
2009-08-11 6:45 ` Artem Bityutskiy
@ 2009-08-11 11:21 ` Artem Bityutskiy
2009-08-12 18:27 ` Daniel Neukomm
0 siblings, 1 reply; 6+ messages in thread
From: Artem Bityutskiy @ 2009-08-11 11:21 UTC (permalink / raw)
To: dedekind1; +Cc: linux-mtd, Daniel Neukomm
On 08/11/2009 09:45 AM, Artem Bityutskiy wrote:
> On Sun, 2009-08-02 at 16:04 +0200, Daniel Neukomm wrote:
>> patch for mkfs.ubifs devtable.c increment in dev_table is wrongly
>> interpreted
>>
>> with the device table one can add /dev entries to the root file system
>> image.
>> The device table file contains among others the fields minor, start,
>> increment and count.
>> If there is an entry with minor=0 start=0 increment =32 and count=4 the
>> mkfs.ubifs makes
>> 128 device entries, with minor numbers from 0 to 127
>> The correct version makes 4 entries with minor number 0,32,64,96.
>>
>> /dev/mtd c 640 0 0 90 0 0 2 7
>> This gives 14 devices /dev/mtdXX instead of 7 devices.
>> Due to this error mtd_debug info /dev/mtd3 delivers the information of
>> /dev/mtd1 instead of.
>
> Ok, below is how you was supposed to send the patch (without my
> Signed-off-by, of course). I just applied your patch manually (usually
> we use git am for this) and tweaked it.
>
> Please, check that I did not do any mistake. After you have confirmed
> this, I'll push this to the mtd-utils repository.
I've pushed it actually to mtd-utils.git. But please, check it anyway.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: patch for mkfs.ubifs devtable.c increment in dev_table is wrongly interpreted
2009-08-11 11:21 ` Artem Bityutskiy
@ 2009-08-12 18:27 ` Daniel Neukomm
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Neukomm @ 2009-08-12 18:27 UTC (permalink / raw)
To: linux-mtd
Artem Bityutskiy schrieb:
> On 08/11/2009 09:45 AM, Artem Bityutskiy wrote:
>> On Sun, 2009-08-02 at 16:04 +0200, Daniel Neukomm wrote:
>>> patch for mkfs.ubifs devtable.c increment in dev_table is wrongly
>>> interpreted
>>>
>>> with the device table one can add /dev entries to the root file system
>>> image.
>>> The device table file contains among others the fields minor, start,
>>> increment and count.
>>> If there is an entry with minor=0 start=0 increment =32 and count=4 the
>>> mkfs.ubifs makes
>>> 128 device entries, with minor numbers from 0 to 127
>>> The correct version makes 4 entries with minor number 0,32,64,96.
>>>
>>> /dev/mtd c 640 0 0 90 0 0 2 7
>>> This gives 14 devices /dev/mtdXX instead of 7 devices.
>>> Due to this error mtd_debug info /dev/mtd3 delivers the information of
>>> /dev/mtd1 instead of.
>>
>> Ok, below is how you was supposed to send the patch (without my
>> Signed-off-by, of course). I just applied your patch manually (usually
>> we use git am for this) and tweaked it.
>>
>> Please, check that I did not do any mistake. After you have confirmed
>> this, I'll push this to the mtd-utils repository.
>
> I've pushed it actually to mtd-utils.git. But please, check it anyway.
>
The new patch (without line-wrapping) works.
The actual trunk version from mtd-utils repository contains the intented
corrections.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-08-12 18:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-02 14:04 patch for mkfs.ubifs devtable.c increment in dev_table is wrongly interpreted Daniel Neukomm
2009-08-03 3:48 ` Mike Frysinger
2009-08-10 7:36 ` Artem Bityutskiy
2009-08-11 6:45 ` Artem Bityutskiy
2009-08-11 11:21 ` Artem Bityutskiy
2009-08-12 18:27 ` Daniel Neukomm
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).