From patchwork Wed Feb 21 12:32:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 876062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Tbe63ck2"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kbQjmIOs"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zmcNl3B6dz9sW0 for ; Wed, 21 Feb 2018 23:33:59 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pnxpghENuxrwt9KtN0V30/603GiHe2DtKd80esnvrkk=; b=Tbe63ck2w+QmRT mEQ3FnuzR6m+axmK6tDzqK88Xzdv+tD7PZjpYdRtQUrYQBP5WaxyIyGhEz1P5v9mGx3bU78kg96+6 xEkN0rWa4QF8vj0gsW7nzMbnKffc07se5hxOtrxYlTrgN9PLqhO+JVLmc/kJrCDebxUX19GRO9Ki2 kJX5s+IgUUqi/yVXEx1Embg79Kwf4RYm7KsOsyVm+DtTyo/OOugeK/C4ldswcKKdiuYKo2I++t1qu 53UY8H2nVBC9EPP0UZ/5YQPcvAWr42ntDgYd07+ILgiuxrDWAtLgLzmbqOuuTrc+BDhgvFmy8SMmL eUFl6UnMV6vu8W6n1bEA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eoTal-0008Gk-2u; Wed, 21 Feb 2018 12:33:47 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eoTZg-0007n6-Iu for lede-dev@lists.infradead.org; Wed, 21 Feb 2018 12:32:44 +0000 Received: by mail-lf0-x243.google.com with SMTP id t79so2120555lfe.3 for ; Wed, 21 Feb 2018 04:32:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=S7XoTEu0p/MIyITdu8JJKBIQwoqoLCOeXk8/lrnFuIA=; b=kbQjmIOsNBKKaZOiICTHH1nMR4t4Zxz/nzyFH7XXGsFNnLCwBpFIup6hH95I44DelJ 3NaWFIVBNsstR15gsHlR1LHgOxoR80U9BBMU0L9mtqZit7UxHOgTGNLE3XVPGtPcONye QYpSowsOGqNwvs2HrrfwoPNUbSAMvhCuEdpag6X+DyjCS5JSurRt4jyAmZf7Csb4J6W6 sPi5TGsojiBLSKHaaGJVJhr6bFL22H49/f4+BTPROID1nb4TaMPg/kGHFnPW1ASqYW+Y W+RH8mpbfTcy4G9JX2jG2Y/EleLSHAfBr+eLKLqsQJ9ByZtkuYx6qp/QyHDeEsLYmM5l fN3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=S7XoTEu0p/MIyITdu8JJKBIQwoqoLCOeXk8/lrnFuIA=; b=kB3OEJwgtKMYEddr95VOZZogYvAnPkUuJiGIQCeh+f4IUv80p5AaMOiy2duEayYzFm rdIS0JBbSQYognQ9xKcw+MnDZJAFHMIcRWDbHOTAhQ47YBXSfdhcdIjUjnxrutXJ9kkp ZnQjRvrRpBpv/y8yShFv6w1pKelvfG1Q9kq/BXWcRp4u/TY/YorU3L3/g9CT18LS/eTW VhOwQRbfMWBD7IcN5SSu19fSL4QHAtfaqotzqBIbcNmQrcxEDImLGVTW1MAe1qCXJGJM wfUR6sYerQjUoY0Q87x1afJsnMJIrdUPeS2lc6FlWX0WKRDkhFTXsfidqpW+Jif+AvMO cihA== X-Gm-Message-State: APf1xPA4DC1ZKzQ1mNjKZflF3jWKlaZqHLWj5c+Wt7XQB/Kj/QsJPNWN jG73I7bBrnUxPMG5eoP/L6k= X-Google-Smtp-Source: AH8x227nKvffBSV8phwg2wDWRej7BTb68JlepEJqnEVJYqugw3f1I5CCmTTqcYYfCX6iHzHDvx0Pvw== X-Received: by 10.46.13.10 with SMTP id 10mr2448452ljn.8.1519216350115; Wed, 21 Feb 2018 04:32:30 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id h16sm1736551lji.72.2018.02.21.04.32.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 04:32:29 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: John Crispin , Jo-Philipp Wich , lede-dev@lists.infradead.org Date: Wed, 21 Feb 2018 13:32:17 +0100 Message-Id: <20180221123217.28211-2-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180221123217.28211-1-zajec5@gmail.com> References: <20180221123217.28211-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180221_043240_722650_7479CB03 X-CRM114-Status: GOOD ( 12.19 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4010:c07:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (zajec5[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zajec5[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [LEDE-DEV] [PATCH mountd 2/2] mount: call hotplug-call with ACTION=remove before trying to unmount X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Rafał Miłecki This increases a chance of successfully unmounting a drive as calling hotplug.d scripts may result in stopping applications using it. Signed-off-by: Rafał Miłecki --- mount.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mount.c b/mount.c index 3994149..00fe91d 100644 --- a/mount.c +++ b/mount.c @@ -774,11 +774,13 @@ static void mount_enum_drives(void) } if(!check_block(q->dev)||del) { - int err; - - err = mount_dev_del(q); if (q->status == STATUS_MOUNTED || q->status == STATUS_EXPIRED) { char dev_link[64]; + int err; + + system_printf("ACTION=remove DEVICE=%s NAME=%s /sbin/hotplug-call mount", q->dev, q->name); + + err = mount_dev_del(q); snprintf(dev_link, sizeof(dev_link), "%s%s", uci_path, q->name); if (err == -EBUSY) { @@ -792,7 +794,6 @@ static void mount_enum_drives(void) log_printf("unlinking %s\n", dev_link); unlink(dev_link); } - system_printf("ACTION=remove DEVICE=%s NAME=%s /sbin/hotplug-call mount", q->dev, q->name); } p->prev->next = p->next;