From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754287AbcBWQLL (ORCPT ); Tue, 23 Feb 2016 11:11:11 -0500 Received: from mail-ob0-f176.google.com ([209.85.214.176]:34890 "EHLO mail-ob0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754265AbcBWQLG (ORCPT ); Tue, 23 Feb 2016 11:11:06 -0500 Date: Tue, 23 Feb 2016 09:11:04 -0700 From: Jens Axboe To: Asai Thambi SP Cc: linux-kernel@vger.kernel.org, Sam Bradshaw , Selvan Mani , Rajesh Kumar Sambandam , Vignesh Gunasekaran Subject: Re: [PATCH 01/10] mtip32xx: Abort secure erase when drive is mounted Message-ID: <20160223161104.GA13712@kernel.dk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 22 2016, Asai Thambi SP wrote: > > To avoid erasing a device with a mounted filesystem, try to get exclusive > access to the blkdev object corresponding to the device. I don't think this needs to be in the kernel, why not just check from the official format tool if the device is mounted or not? -- Jens Axboe