Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S939327AbdD0XMs (ORCPT ); Thu, 27 Apr 2017 19:12:48 -0400 Received: from mga01.intel.com ([192.55.52.88]:21306 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752832AbdD0XMk (ORCPT ); Thu, 27 Apr 2017 19:12:40 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,386,1488873600"; d="scan'208";a="1141072635" From: "Verma, Vishal L" To: "Williams, Dan J" , "axboe@fb.com" CC: "hch@lst.de" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "martin.petersen@oracle.com" Subject: Re: [PATCH] block: hide badblocks attribute by default Thread-Topic: [PATCH] block: hide badblocks attribute by default Thread-Index: AQHSv6CON5ijnKT9M02E4KjQTpOk86HaTTsA Date: Thu, 27 Apr 2017 23:12:38 +0000 Message-ID: <1493334676.30844.5.camel@intel.com> References: <149332958627.40858.3562179022452904734.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <149332958627.40858.3562179022452904734.stgit@dwillia2-desk3.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.232.112.53] Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v3RNCvsJ019419 Content-Length: 1038 Lines: 27 On Thu, 2017-04-27 at 14:46 -0700, Dan Williams wrote: > Commit 99e6608c9e74 "block: Add badblock management for gendisks" > allowed for drivers like pmem and software-raid to advertise a list of > bad media areas. However, it inadvertently added a 'badblocks' to all > block devices. Lets clean this up by having the 'badblocks' attribute > not be visible when the driver has not populated a 'struct badblocks' > instance in the gendisk. > > Cc: Jens Axboe > Cc: Christoph Hellwig > Cc: Martin K. Petersen > Reported-by: Vishal Verma > Signed-off-by: Dan Williams > --- >  block/genhd.c |   11 +++++++++++ >  1 file changed, 11 insertions(+) > Tested that this removes the badblocks attribute for block devices that don't use them: $ cat /sys/block/pmem6/badblocks  61576 8 $ cat /sys/block/vda/badblocks  cat: /sys/block/vda/badblocks: No such file or directory Tested-by: Vishal Verma