From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 8/7][retry remove] Also add check for filesystem use on a DM/LVM device - "dm_device_has_fs"
Date: Wed, 21 Sep 2011 13:39:47 +0200 [thread overview]
Message-ID: <4E79CD03.2060000@redhat.com> (raw)
In-Reply-To: <4E79A2AE.5040708@redhat.com>
Dne 21.9.2011 10:39, Peter Rajnoha napsal(a):
> On 09/20/2011 09:15 PM +0100, Peter Rajnoha wrote:
>> diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
>> index 7ea78af..37b6902 100644
>> --- a/libdm/libdm-common.c
>> +++ b/libdm/libdm-common.c
>
>> +int dm_device_has_fs(uint32_t major, uint32_t minor)
>> +{
>> + char sysfs_path[PATH_MAX];
>> + char temp_path[PATH_MAX];
>> + size_t size;
>
> I've just noticed - this must be int size!!!
>
>> + char *kernel_dev_name;
>> +
>> + /* Get kernel device name first */
>> + if (dm_snprintf(sysfs_path, PATH_MAX, "%sdev/block/%" PRIu32 ":%" PRIu32,
>> + _sysfs_dir, major, minor) < 0) {
>> + log_error("sysfs_path dm_snprintf failed");
>> + return 0;
>> + }
>> +
>> + if ((size = readlink(sysfs_path, temp_path, PATH_MAX)) < 0) {
>
> ...because of this check.
>
Or even better use types from declaration:
ssize_t readlink(const char *path, char *buf, size_t bufsiz);
Zdenek
prev parent reply other threads:[~2011-09-21 11:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-20 19:15 [PATCH 8/7][retry remove] Also add check for filesystem use on a DM/LVM device - "dm_device_has_fs" Peter Rajnoha
2011-09-20 20:01 ` Zdenek Kabelac
2011-09-21 8:55 ` Milan Broz
2011-09-21 10:22 ` Zdenek Kabelac
2011-09-21 8:39 ` Peter Rajnoha
2011-09-21 11:39 ` Zdenek Kabelac [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E79CD03.2060000@redhat.com \
--to=zkabelac@redhat.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.