From patchwork Mon Dec 10 21:29:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Michal_Such=C3=A1nek?= X-Patchwork-Id: 10722569 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77D9B1751 for ; Mon, 10 Dec 2018 21:29:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 688402A204 for ; Mon, 10 Dec 2018 21:29:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A9642A263; Mon, 10 Dec 2018 21:29:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D9232A204 for ; Mon, 10 Dec 2018 21:29:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728959AbeLJV3v (ORCPT ); Mon, 10 Dec 2018 16:29:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:35780 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727034AbeLJV3v (ORCPT ); Mon, 10 Dec 2018 16:29:51 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F30A7AE65 for ; Mon, 10 Dec 2018 21:29:49 +0000 (UTC) From: Michal Suchanek To: linux-modules@vger.kernel.org Cc: Michal Suchanek Subject: [PATCH v2 0/3] Fix dependency file corruption with parallel depmod invocation Date: Mon, 10 Dec 2018 22:29:31 +0100 Message-Id: X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181207154557.5865-1-msuchanek@suse.de> References: <20181207154557.5865-1-msuchanek@suse.de> MIME-Version: 1.0 Sender: owner-linux-modules@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The files produced by depmod may be corrupted if multiple depmod processes running in parallel try to update them. Since there is nothing stopping the user running depmod in parallel this looks like a bug in depmod. When a package manager is used it synchronizes adding or removeing module files and depmod invocation. However, user might use other script that is not synchronized with package manager or invoke depmod by hand. When global synchronizarion is missing we cannot guarantee completely consistent state because adding and removing module files is anynchronous. However, we should guarantee the system is bootable if the user did not remove the modules needed for boot. For that the dependency file should not get removed or corrupted. Thanks Michal Michal Suchanek (3): depmod: prevent module dependency files missing during depmod invocation. depmod: prevent module dependency files corruption due to parallel invocation. depmod: shut up gcc insufficinet buffer warning. tools/depmod.c | 64 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 20 deletions(-)