public inbox for lvm2-cvs@sourceware.org help / color / mirror / Atom feed
From: zkabelac@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/libdm libdm-deptree.c ioctl/libdm-iface.c ... Date: Wed, 19 Oct 2011 16:36:00 -0000 [thread overview] Message-ID: <20111019163603.26848.qmail@sourceware.org> (raw) CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2011-10-19 16:36:02 Modified files: libdm : libdm-deptree.c libdm/ioctl : libdm-iface.c libdm-targets.h Log message: Add internal expected_errno dm_tast var Certain errno codes could be expected in some situations thus add experimental support for them. When expected errno is set after ioctl error - function skips error printing and exits succefully. Currently only useful for thin pool messages. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.128&r2=1.129 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-iface.c.diff?cvsroot=lvm2&r1=1.124&r2=1.125 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-targets.h.diff?cvsroot=lvm2&r1=1.32&r2=1.33 --- LVM2/libdm/libdm-deptree.c 2011/10/17 14:16:25 1.128 +++ LVM2/libdm/libdm-deptree.c 2011/10/19 16:36:01 1.129 @@ -111,6 +111,7 @@ struct thin_message { struct dm_list list; struct dm_thin_message message; + int expected_errno; }; /* Replicator-log has a list of sites */ @@ -1314,6 +1315,9 @@ if (!dm_task_set_message(dmt, buf)) goto_out; + /* Internal functionality of dm_task */ + dmt->expected_errno = tm->expected_errno; + if (!dm_task_run(dmt)) goto_out; @@ -2912,11 +2916,13 @@ if (!_thin_validate_device_id(message->u.m_create_thin.device_id)) return_0; tm->message.u.m_create_thin.device_id = message->u.m_create_thin.device_id; + tm->expected_errno = EEXIST; break; case DM_THIN_MESSAGE_DELETE: if (!_thin_validate_device_id(message->u.m_delete.device_id)) return_0; tm->message.u.m_delete.device_id = message->u.m_delete.device_id; + tm->expected_errno = ENODATA; break; case DM_THIN_MESSAGE_TRIM: if (!_thin_validate_device_id(message->u.m_trim.device_id)) --- LVM2/libdm/ioctl/libdm-iface.c 2011/10/17 14:36:06 1.124 +++ LVM2/libdm/ioctl/libdm-iface.c 2011/10/19 16:36:02 1.125 @@ -1635,7 +1635,8 @@ dmt->sector, _sanitise_message(dmt->message), dmi->data_size, retry_repeat_count); #ifdef DM_IOCTLS - if (ioctl(_control_fd, command, dmi) < 0) { + if (ioctl(_control_fd, command, dmi) < 0 && + dmt->expected_errno != errno) { if (errno == ENXIO && ((dmt->type == DM_DEVICE_INFO) || (dmt->type == DM_DEVICE_MKNODES) || (dmt->type == DM_DEVICE_STATUS))) --- LVM2/libdm/ioctl/libdm-targets.h 2011/09/22 17:09:49 1.32 +++ LVM2/libdm/ioctl/libdm-targets.h 2011/10/19 16:36:02 1.33 @@ -65,6 +65,7 @@ int secure_data; int retry_remove; int enable_checks; + int expected_errno; char *uuid; };
reply other threads:[~2011-10-19 16:36 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20111019163603.26848.qmail@sourceware.org \ --to=zkabelac@sourceware.org \ --cc=lvm-devel@redhat.com \ --cc=lvm2-cvs@sourceware.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).