[lkml]   [2010]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [dm-devel] [PATCH v3 3/3] dm: lookup devices by path with name_to_dev_t
On Mon, May 24, 2010 at 6:38 AM, Alasdair G Kergon <> wrote:
> I'll apply this, [snip]


On Mon, May 24, 2010 at 6:57 AM, Alasdair G Kergon <> wrote:
> On Wed, May 19, 2010 at 01:38:24PM -0500, Will Drewry wrote:
>> +     char base_path[32];  /* size from name_to_dev_t */
>> +     /* stage the shorter path for name_to_dev_t. */
>> +     strncpy(base_path, path, sizeof(base_path));
> I'm dropping that, and just passing path directly, so the strlen test
> will be used.  (There's a "name += 5" in there so 32 would ignore
> any longer standard names anyway.)

Sounds good. And nice catch on the truncation with 32 - in an
attempt to minimize the extra copying, I went a bit too far!

fwiw, the only reason for the copy was because |path| is a
const in the function but not when passed to name_to_dev_t.
I wasn't sure what the preferred practice was so I just duped
the data needed.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2010-05-24 16:47    [W:0.047 / U:46.592 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site