From patchwork Thu Jun 30 01:59:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 642304 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rg2vJ3Q5Dz9sCk for ; Thu, 30 Jun 2016 12:05:48 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIRII-0004hC-4z; Thu, 30 Jun 2016 02:01:30 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIRI9-0004Cc-8R; Thu, 30 Jun 2016 02:01:26 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBC8DC00B8F9; Thu, 30 Jun 2016 02:01:00 +0000 (UTC) Received: from ad.usersys.redhat.com (dhcp-15-133.nay.redhat.com [10.66.15.133]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5U201qT029340; Wed, 29 Jun 2016 22:00:54 -0400 From: Fam Zheng To: linux-kernel@vger.kernel.org Subject: [PATCH v2 08/12] zram: Generate uevent after attribute available Date: Thu, 30 Jun 2016 09:59:49 +0800 Message-Id: <20160630015953.6888-9-famz@redhat.com> In-Reply-To: <20160630015953.6888-1-famz@redhat.com> References: <20160630015953.6888-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 30 Jun 2016 02:01:01 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160629_190121_630683_17E0360D X-CRM114-Status: GOOD ( 11.64 ) X-Spam-Score: -8.3 (--------) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-8.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.132.183.28 listed in wl.mailspike.net] -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [209.132.183.28 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , Sergey Senozhatsky , "Michael S. Tsirkin" , Benjamin Herrenschmidt , linux-nvme@lists.infradead.org, virtualization@lists.linux-foundation.org, Keith Busch , Paul Mackerras , Michael Ellerman , Christoph Hellwig , Shaohua Li , Nitin Gupta , famz@redhat.com, Jiri Kosina , linux-block@vger.kernel.org, "Ed L. Cashin" , Jens Axboe , linux-raid@vger.kernel.org, David Woodhouse , linux-mmc@vger.kernel.org, Minchan Kim , linux-mtd@lists.infradead.org, Brian Norris , linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org It is documented that KOBJ_ADD should be generated after the object's attributes and children are ready. We can achieve this with the new disk_gen_uevents interface. Signed-off-by: Fam Zheng --- drivers/block/zram/zram_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index d735513..83f10a0 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1287,7 +1287,7 @@ static int zram_add(void) zram->disk->queue->limits.discard_zeroes_data = 0; queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, zram->disk->queue); - add_disk(zram->disk, true); + add_disk(zram->disk, false); ret = sysfs_create_group(&disk_to_dev(zram->disk)->kobj, &zram_disk_attr_group); @@ -1296,6 +1296,7 @@ static int zram_add(void) device_id); goto out_free_disk; } + disk_gen_uevents(zram->disk); strlcpy(zram->compressor, default_compressor, sizeof(zram->compressor)); zram->meta = NULL;