From patchwork Thu Feb 26 08:14:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boaz Harrosh X-Patchwork-Id: 5888971 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B5111BF6C3 for ; Thu, 26 Feb 2015 08:14:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1AE5202A1 for ; Thu, 26 Feb 2015 08:14:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15F9E20382 for ; Thu, 26 Feb 2015 08:14:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753212AbbBZIOu (ORCPT ); Thu, 26 Feb 2015 03:14:50 -0500 Received: from mail-we0-f170.google.com ([74.125.82.170]:36665 "EHLO mail-we0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751216AbbBZIOt (ORCPT ); Thu, 26 Feb 2015 03:14:49 -0500 Received: by wevk48 with SMTP id k48so8432426wev.3 for ; Thu, 26 Feb 2015 00:14:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=ED1DSG/fV2YjTGAOq+CovDj89JQVBzEVqu2+tE8Vq8g=; b=X4Dv/EcHxQBLqOyT/lrYt1uDguPr6dgUyJjotjOdh/QnJT9h4SXkeGUJibePM6b1jd 7Yg3vyoo4odm8/fnTvaYyNK+PJtsCXaN3THW4DzQu6QsD//lujrhCTCqw8z2M3v5P474 01TFb3Poea3zj8dVHrDAYEVyXdhVAaiGOV79Jm0XN6SGKWcB15hITsRfPUuteY4F4xuh wedWBTODHjGP3UQBy9mD+AYlCV0tqM3E37abZ2xbUImDzEIu8UcHiNF/ZkWoFbJ6jwpW i5MFWSsOq3WrcAmY+OcPsQ5feJwaLgmZ+DgPAsA8e8X2+KK5+DhigJswqFmPGb+drsTK XS6g== X-Gm-Message-State: ALoCoQkKdnsX0B3hqAWBhBqtm9OMxvWiwTJPdINC3WfQAakBwRiuo2QhPyFGXFafG88TEy2QLJqG X-Received: by 10.194.78.144 with SMTP id b16mr14025297wjx.18.1424938488007; Thu, 26 Feb 2015 00:14:48 -0800 (PST) Received: from [10.0.0.5] ([207.232.55.62]) by mx.google.com with ESMTPSA id bo1sm218366wjb.15.2015.02.26.00.14.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 00:14:47 -0800 (PST) Message-ID: <54EED5F6.2030804@plexistor.com> Date: Thu, 26 Feb 2015 10:14:46 +0200 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jens Axboe , Dave Chinner CC: Brian Foster , fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH] brd: Re-instate ram disk visibility option (part_show) References: <1424818479-10083-1-git-send-email-david@fromorbit.com> <1424818479-10083-2-git-send-email-david@fromorbit.com> <20150225161151.GC28053@bfoster.bfoster> <20150225223248.GH4251@dastard> In-Reply-To: <20150225223248.GH4251@dastard> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This re-enables part_show option, so we can keep it false by default. Here is what Dmitry said in the original patch: [aeac318] brd: add ram disk visibility option Currently ram disk is not visible inside /proc/partitions. This was done for compatibility reasons here: 53978d0a7a27. But some utilities expect disk presents in /proc/partitions. Let's add module's option and let's administrator chose visibility behavior. By default, old behavior preserved. Dave Chinner and other have reported problems with current system when udev events start firing for ramdisk: http://marc.info/?l=linux-fsdevel&m=142490357918672&w=2 It was me who enabled these notifications through this patch: [937af5e] brd: Fix all partitions BUGs Sorry for the mess. CC: Dave Chinner CC: Dmitry Monakhov Signed-off-by: Boaz Harrosh --- drivers/block/brd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/block/brd.c b/drivers/block/brd.c index 64ab495..6e0775b 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -450,6 +450,10 @@ static int max_part = 1; module_param(max_part, int, S_IRUGO); MODULE_PARM_DESC(max_part, "Num Minors to reserve between devices"); +static int part_show = 0; +module_param(part_show, int, S_IRUGO); +MODULE_PARM_DESC(part_show, "Control RAM disk visibility in /proc/partitions"); + MODULE_LICENSE("GPL"); MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR); MODULE_ALIAS("rd"); @@ -513,6 +517,8 @@ static struct brd_device *brd_alloc(int i) disk->private_data = brd; disk->queue = brd->brd_queue; disk->flags = GENHD_FL_EXT_DEVT; + if (!part_show) + disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO; sprintf(disk->disk_name, "ram%d", i); set_capacity(disk, rd_size * 2);