Skip to contentSkip to conversation

dm: make alloc error info more clearly.

PATCH In review Robin Dong 3 participants 4 messages Jul 7, 2013 – Jul 8, 2013 Device mapper

lore
Share & tools
lore

Robin Dong

author
#0 lore raw

PATCH 1/1 dm: make alloc error info more clearly.

From: Robin Dong <[email protected]>

If dm-delay structure allocation failed, report more precise error information.

If dm-flakey structure alocation failed, it will report wrong error information which should be fixed.

---
 drivers/md/dm-delay.c  |    2 +-
 drivers/md/dm-flakey.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/md/dm-delay.c +1 -1
index 496d5f3..dfc26f1 100644
@@ -140,7 +140,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 
 	dc = kmalloc(sizeof(*dc), GFP_KERNEL);
 	if (!dc) {
-		ti->error = "Cannot allocate context";
+		ti->error = "Cannot allocate delay context";
 		return -ENOMEM;
 	}
 
drivers/md/dm-flakey.c +1 -1
index 7fcf21c..9ab809f 100644
@@ -176,7 +176,7 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 
 	fc = kzalloc(sizeof(*fc), GFP_KERNEL);
 	if (!fc) {
-		ti->error = "Cannot allocate linear context";
+		ti->error = "Cannot allocate flakey context";
 		return -ENOMEM;
 	}
 	fc->start_time = jiffies;
Signature · 1 line
1.7.1
#1 lore raw
Quoted 1 line · Robin Dong

If dm-delay structure allocation failed, report more precise error information.

Do you have some test result that shows this?

  DMERR("%s: %s: %s", dm_device_name(t->md), type, tgt->error);

?

Alasdair

author
#2 lore raw

2013/7/7 Alasdair G Kergon <[email protected]>

Quoted 3 lines · Robin Dong
Quoted 1 line

If dm-delay structure allocation failed, report more precise error

information.

Quoted 6 lines

Do you have some test result that shows this?

  DMERR("%s: %s: %s", dm_device_name(t->md), type, tgt->error);

?

Oh, sorry for my omission.
But I stil think that print "Cannot allocate linear context" in dm-flakey is puzzling...

Quoted 3 lines

Alasdair

--
--
Best Regard
Robin Dong

#3 lore raw
Quoted 8 lines · Robin Dong

2013/7/7 Alasdair G Kergon <[email protected]>

Quoted 3 lines · Robin Dong
Quoted 1 line

If dm-delay structure allocation failed, report more precise error

information.

Quoted 3 lines

Do you have some test result that shows this?

Quoted 7 lines
Quoted 3 lines
  DMERR("%s: %s: %s", dm_device_name(t->md), type, tgt->error);

?

Oh, sorry for my omission.
But I stil think that print "Cannot allocate linear context" in dm-flakey is puzzling...

Yeah, that should get fixed up (with s/linear //), clearly got introduced via cut and paste.