[PATCH] sg3_utils sg_map: add support for sparse 3-character disk names

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

 



I'm not sure if this patch would be useful (or desirable) to anyone else,
but I thought I'd share it just in case.

Using udev to assign 3 character sd names (sdaaa, for example), generated
based on where a disk is physically located. There are problems using sg_map
in this situation for two reasons: 1) the names are too long, and 2) the
names are sparsely allocated and sg_map doesn't like this.

This patch (sg_map.c.1.14.patch, against version 1.14 of sg3_utils) modifies
sg_map to allow 3 character sparse names. Here's what I changed:

- increase MAX_SD_DEVS to the maximum # for up to 3 character names
- modified make_dev_name to handle 3 character names
- ignore ENOENT in scan_dev_type to allow for names to be sparsely allocated

This was the quickest, easiest way to make sg_map work in this situation...
I realize it's not a nice general solution to the problem.
 
Nate Dailey
Stratus Technologies


Signed-off-by: Nate Dailey <nate.dailey@xxxxxxxxxxx>

Attachment: sg_map.c-1.14.patch
Description: Binary data


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux