* Re: fdisk: off-by-one issue in (n)new command [not found] ` <CAMFXF50uHCU4yhwe3byAsTKvPpi8F63mR9O4TfKhuANiEL_v0Q@mail.gmail.com> @ 2012-01-16 21:54 ` Gerardo Exequiel Pozzi 2012-01-16 22:30 ` Gerardo Exequiel Pozzi 0 siblings, 1 reply; 6+ messages in thread From: Gerardo Exequiel Pozzi @ 2012-01-16 21:54 UTC (permalink / raw) To: util-linux On 01/16/2012 06:38 PM, Francesco Cosoleto wrote: > 2012/1/12 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar>: >> I think I found two related bugs, steps to reproduce will be more clear than >> a description: >> It is present in stable 2.20.1 and using latest git snapshot, and using any >> device/file as disk, using here a loop dev with a backing file of 256MiB >> just for example. > Fixed. Thank you for the report. > > http://git.kernel.org/?p=utils/util-linux/util-linux.git;a=commit;h=0c381880282b9365aaf9e8457c69750c12c4d9b2 > -- > To unsubscribe from this list: send the line "unsubscribe util-linux" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Thank you! I will test it in few hours ;) -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: fdisk: off-by-one issue in (n)new command 2012-01-16 21:54 ` fdisk: off-by-one issue in (n)new command Gerardo Exequiel Pozzi @ 2012-01-16 22:30 ` Gerardo Exequiel Pozzi 2012-01-17 10:07 ` Karel Zak 0 siblings, 1 reply; 6+ messages in thread From: Gerardo Exequiel Pozzi @ 2012-01-16 22:30 UTC (permalink / raw) To: util-linux On 01/16/2012 06:54 PM, Gerardo Exequiel Pozzi wrote: > On 01/16/2012 06:38 PM, Francesco Cosoleto wrote: >> 2012/1/12 Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar>: >>> I think I found two related bugs, steps to reproduce will be more >>> clear than >>> a description: >>> It is present in stable 2.20.1 and using latest git snapshot, and >>> using any >>> device/file as disk, using here a loop dev with a backing file of >>> 256MiB >>> just for example. >> Fixed. Thank you for the report. >> >> http://git.kernel.org/?p=utils/util-linux/util-linux.git;a=commit;h=0c381880282b9365aaf9e8457c69750c12c4d9b2 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe util-linux" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> > Thank you! > > I will test it in few hours ;) > Works fine (default value after out-of-range) :) Still remains the other bug that does not allow to specify "last sector" that just fits the size in +sectors/+N(K|M|G). Example: Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): Using default response p Partition number (1-4, default 1): Using default value 1 First sector (2048-524287, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-524287, default 524287): +255M Value out of range. Last sector, +sectors or +size{K,M,G} (2048-524287, default 524287): +261120K Value out of range. Last sector, +sectors or +size{K,M,G} (2048-524287, default 524287): +522240 Value out of range. Last sector, +sectors or +size{K,M,G} (2048-524287, default 524287): +522239 Partition 1 of type Linux and of size 255 MiB is set Command (m for help): p Disk /dev/vdb: 268 MB, 268435456 bytes 16 heads, 63 sectors/track, 520 cylinders, total 524288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xbfd7539b Device Boot Start End Blocks Id System /dev/vdb1 2048 524287 261120 83 Linux -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: fdisk: off-by-one issue in (n)new command 2012-01-16 22:30 ` Gerardo Exequiel Pozzi @ 2012-01-17 10:07 ` Karel Zak 2012-01-17 14:55 ` Gerardo Exequiel Pozzi 0 siblings, 1 reply; 6+ messages in thread From: Karel Zak @ 2012-01-17 10:07 UTC (permalink / raw) To: Gerardo Exequiel Pozzi; +Cc: util-linux On Mon, Jan 16, 2012 at 07:30:42PM -0300, Gerardo Exequiel Pozzi wrote: > Last sector, +sectors or +size{K,M,G} (2048-524287, default 524287): +255M > Value out of range. The size of the device is 268435456 bytes, +255M is relative to the begin of the partition, it means (2048 * 512) + (255 * 1024 * 1024) = 268435456 bytes but the begin of the last sector (in bytes) is 268435456 - 512 = 268434944 bytes (LBA sector 524287) Right? Karel -- Karel Zak <kzak@redhat.com> http://karelzak.blogspot.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: fdisk: off-by-one issue in (n)new command 2012-01-17 10:07 ` Karel Zak @ 2012-01-17 14:55 ` Gerardo Exequiel Pozzi 2012-01-20 14:21 ` Francesco Cosoleto 0 siblings, 1 reply; 6+ messages in thread From: Gerardo Exequiel Pozzi @ 2012-01-17 14:55 UTC (permalink / raw) To: util-linux On 01/17/2012 07:07 AM, Karel Zak wrote: > On Mon, Jan 16, 2012 at 07:30:42PM -0300, Gerardo Exequiel Pozzi wrote: >> Last sector, +sectors or +size{K,M,G} (2048-524287, default 524287): +255M >> Value out of range. > The size of the device is 268435456 bytes, > > +255M is relative to the begin of the partition, it means > > (2048 * 512) + (255 * 1024 * 1024) = 268435456 bytes Right. > > but the begin of the last sector (in bytes) is > > 268435456 - 512 = 268434944 bytes (LBA sector 524287) > > Right? Right. From [2048, 524287] (all inclusive), so (524287 - 2048 + 1) * 512 = 522240 and 522240 * 512 / 2**20 = 255 Indeed, when you say, for example, these sizes: p1 = +55M, p2 = +100M, and now try to set +100M to p3, is not posible, so accept the default value, and you can see that the size is equal to p2, that is right. So the issue appears when last sector is specified in +sectors or +size(K|M|G), only -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: fdisk: off-by-one issue in (n)new command 2012-01-17 14:55 ` Gerardo Exequiel Pozzi @ 2012-01-20 14:21 ` Francesco Cosoleto 2012-01-22 1:37 ` Gerardo Exequiel Pozzi 0 siblings, 1 reply; 6+ messages in thread From: Francesco Cosoleto @ 2012-01-20 14:21 UTC (permalink / raw) To: Gerardo Exequiel Pozzi; +Cc: util-linux I wonder whether this is a preferred behavior: Partition number (1-4, default 1): 5 Value 5 out of range, used 4. First sector (2048-16383, default 2048): 1024 Value 1024 out of range, used 2048. Last sector, +sectors or +size{K,M,G} (2048-16383, default 16383): +8M Value 18432 out of range, used 16383. Partition 4 of type Linux and of size 7 MiB is set Francesco ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: fdisk: off-by-one issue in (n)new command 2012-01-20 14:21 ` Francesco Cosoleto @ 2012-01-22 1:37 ` Gerardo Exequiel Pozzi 0 siblings, 0 replies; 6+ messages in thread From: Gerardo Exequiel Pozzi @ 2012-01-22 1:37 UTC (permalink / raw) To: util-linux On 01/20/2012 11:21 AM, Francesco Cosoleto wrote: > I wonder whether this is a preferred behavior: > > Partition number (1-4, default 1): 5 > Value 5 out of range, used 4. > First sector (2048-16383, default 2048): 1024 > Value 1024 out of range, used 2048. > Last sector, +sectors or +size{K,M,G} (2048-16383, default 16383): +8M > Value 18432 out of range, used 16383. > Partition 4 of type Linux and of size 7 MiB is set > > Francesco > -- > To unsubscribe from this list: send the line "unsubscribe util-linux" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Sounds good for me. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-01-22 1:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <4F0E167A.9090205@yahoo.com.ar>
[not found] ` <CAMFXF50uHCU4yhwe3byAsTKvPpi8F63mR9O4TfKhuANiEL_v0Q@mail.gmail.com>
2012-01-16 21:54 ` fdisk: off-by-one issue in (n)new command Gerardo Exequiel Pozzi
2012-01-16 22:30 ` Gerardo Exequiel Pozzi
2012-01-17 10:07 ` Karel Zak
2012-01-17 14:55 ` Gerardo Exequiel Pozzi
2012-01-20 14:21 ` Francesco Cosoleto
2012-01-22 1:37 ` Gerardo Exequiel Pozzi
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).