[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#820156: parse_numeric function cannot handle composite device numbers of more than 8 hex digits



Control: severity -1 wishlist

On Tue, 2016-04-05 at 19:13 -0400, Stephen Powell wrote:
> Package: initramfs-tools-core
> Version: 0.123
> Severity: minor
> Tags: patch
> 
> Congratulations on initramfs-tools version 0.123!  Many bugs in version 0.120
> have been fixed in this version.  However, it appears that the parse_numeric
> function, while improved over the 0.120 version, still doesn't handle the
> general case of a composite device number.  It seems it will only handle 8 hex
> digits or less correctly.
> 
> I have submitted a patch for your consideration.  The patch will accommodate the
> general case of a composite device number of up to 16 hex digits (the limit).
> It also tightens up some other error checking corner cases.

I'm not applying this until the kernel actually supports device numbers
that large.  Currently it defines (in include/linux/kdev_t.h):

static inline u32 new_encode_dev(dev_t dev) { ... }
static inline dev_t new_decode_dev(u32 dev) { ... }

static inline u64 huge_encode_dev(dev_t dev)
{
	return new_encode_dev(dev);
}

static inline dev_t huge_decode_dev(u64 dev)
{
	return new_decode_dev(dev);
}

i.e. anything above bit 31 is zeroed.

Ben.

-- 
Ben Hutchings
Never attribute to conspiracy what can adequately be explained by stupidity.

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: