From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22003 invoked by alias); 23 Sep 2011 17:16:31 -0000 Received: (qmail 21972 invoked by uid 9447); 23 Sep 2011 17:16:29 -0000 Date: Fri, 23 Sep 2011 17:16:00 -0000 Message-ID: <20110923171629.21970.qmail@sourceware.org> From: agk@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/libdm/ioctl libdm-iface.c Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00115.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2011-09-23 17:16:28 Modified files: libdm/ioctl : libdm-iface.c Log message: explain why we may now retry Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-iface.c.diff?cvsroot=lvm2&r1=1.122&r2=1.123 --- LVM2/libdm/ioctl/libdm-iface.c 2011/09/22 17:59:58 1.122 +++ LVM2/libdm/ioctl/libdm-iface.c 2011/09/23 17:16:28 1.123 @@ -1654,6 +1654,11 @@ _cmd_data_v4[dmt->type].name, strerror(errno)); + /* + * It's sometimes worth retrying after EBUSY in case + * it's a transient failure caused by an asynchronous + * process quickly scanning the device. + */ *retryable = errno == EBUSY; _dm_zfree_dmi(dmi); @@ -1739,6 +1744,12 @@ repeat_ioctl: if (!(dmi = _do_dm_ioctl(dmt, command, _ioctl_buffer_double_factor, ioctl_retry, &retryable))) { + /* + * Async udev rules that scan devices commonly cause transient + * failures. Normally you'd expect the user to have made sure + * nothing was using the device before issuing REMOVE, so it's + * worth retrying in case the failure is indeed transient. + */ if (retryable && dmt->type == DM_DEVICE_REMOVE && dmt->retry_remove && ++ioctl_retry <= DM_IOCTL_RETRIES) { usleep(DM_RETRY_USLEEP_DELAY);