From patchwork Tue May 14 14:45:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Yi X-Patchwork-Id: 10943113 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 0A618924 for ; Tue, 14 May 2019 14:40:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF783286E4 for ; Tue, 14 May 2019 14:40:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE09E28800; Tue, 14 May 2019 14:40:49 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 A1420287BB for ; Tue, 14 May 2019 14:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726363AbfENOkt (ORCPT ); Tue, 14 May 2019 10:40:49 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8189 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726107AbfENOkt (ORCPT ); Tue, 14 May 2019 10:40:49 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id DDC09F6CE1E7655CB130; Tue, 14 May 2019 22:40:42 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Tue, 14 May 2019 22:40:34 +0800 From: "zhangyi (F)" To: CC: , , Subject: [PATCH 0/2] block: add info messages when opening a block device O_WRITE and O_EXCL concurrently Date: Tue, 14 May 2019 22:45:04 +0800 Message-ID: <1557845106-60163-1-git-send-email-yi.zhang@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Open an exclusive-opened block device for write or open a write-opened block deviece exclusively cannot make sure it is exclusive enough. So it may corrupt the block device when some one writing data through the counterpart raw block device, such as corrupt a mounted file system. And it is hard to find the bad process who corrupt the device after something bad happens. Although we can watch the block device in the user space, we still want the kernel can give us some messages if that happens for some special cases. So this patch set want to add some info messages to hint the potential data corruption. zhangyi (F) (2): block: add info when opening an exclusive opened block device for write block: add info when opening a write opend block device exclusively fs/block_dev.c | 38 +++++++++++++++++++++++++++++++++++--- include/linux/fs.h | 1 + 2 files changed, 36 insertions(+), 3 deletions(-)