From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752016AbbEDGb5 (ORCPT ); Mon, 4 May 2015 02:31:57 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:35127 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751640AbbEDGbu (ORCPT ); Mon, 4 May 2015 02:31:50 -0400 Date: Mon, 4 May 2015 15:32:06 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Sergey Senozhatsky , Andrew Morton , Nitin Gupta , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality Message-ID: <20150504063206.GB772@swordfish> References: <20150429001624.GA3917@swordfish> <20150429064858.GA5125@blaptop> <20150429070218.GA616@swordfish> <20150429072328.GA2987@swordfish> <20150430054702.GA21771@blaptop> <20150430063457.GA950@swordfish> <20150430064436.GB21771@blaptop> <20150430065111.GC950@swordfish> <20150504022008.GA14452@blaptop> <20150504022816.GB14452@blaptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150504022816.GB14452@blaptop> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (05/04/15 11:28), Minchan Kim wrote: > [minchan]: use zram->claim to avoid lockdep splat > Reported-by: Minchan Kim > Signed-off-by: Sergey Senozhatsky > --- will take a look today, cleanup and re-submit. thanks! > /* > * Remove sysfs first, so no one will perform a disksize > - * store while we destroy the devices > + * store while we destroy the devices. This also helps during > + * zram_remove() -- device_reset() is the last holder of > + * ->init_lock. > */ > sysfs_remove_group(&disk_to_dev(zram->disk)->kobj, > &zram_disk_attr_group); > > + /* Make sure all pending I/O is finished */ > + fsync_bdev(bdev); > zram_reset_device(zram); > + mutex_unlock(&bdev->bd_mutex); - mutex_unlock(&bdev->bd_mutex); > + pr_info("Removed device: %s\n", zram->disk->disk_name); > + > idr_remove(&zram_index_idr, zram->disk->first_minor); > blk_cleanup_queue(zram->disk->queue); > del_gendisk(zram->disk); > put_disk(zram->disk); > kfree(zram); > + > + return 0; > } [..] -ss