summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-ioctl.c
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2009-01-06 04:05:04 +0100
committerAlasdair G Kergon <agk@redhat.com>2009-01-06 04:05:04 +0100
commit23d39f63aa87e812fd879b8bc32ee6ccfe733de3 (patch)
tree3535af0aff56260cdbf573a704e3f0122c6cfc8b /drivers/md/dm-ioctl.c
parentdm log: ensure log bitmap fits on log device (diff)
downloadlinux-23d39f63aa87e812fd879b8bc32ee6ccfe733de3.tar.xz
linux-23d39f63aa87e812fd879b8bc32ee6ccfe733de3.zip
dm ioctl: allow dm_copy_name_and_uuid to return only one field
Allow NULL buffer in dm_copy_name_and_uuid if you only want to return one of the fields. (Required by a following patch that adds these fields to sysfs.) Signed-off-by: Milan Broz <mbroz@redhat.com> Reviewed-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r--drivers/md/dm-ioctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 777c948180f9..8da7a017b4ef 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1550,8 +1550,10 @@ int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid)
goto out;
}
- strcpy(name, hc->name);
- strcpy(uuid, hc->uuid ? : "");
+ if (name)
+ strcpy(name, hc->name);
+ if (uuid)
+ strcpy(uuid, hc->uuid ? : "");
out:
up_read(&_hash_lock);