From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f67.google.com ([74.125.83.67]:35255 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbcKZGip (ORCPT ); Sat, 26 Nov 2016 01:38:45 -0500 Date: Sat, 26 Nov 2016 15:37:01 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Andrew Morton , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Takashi Iwai , Hyeoncheol Lee , yjay.kim@lge.com, Sangseok Lee , Hugh Dickins , stable@vger.kernel.org Subject: Re: [PATCH v3 3/3] zram: support BDI_CAP_STABLE_WRITES Message-ID: <20161126063701.GA521@tigerII> References: <1480062914-25556-1-git-send-email-minchan@kernel.org> <1480062914-25556-4-git-send-email-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1480062914-25556-4-git-send-email-minchan@kernel.org> Sender: stable-owner@vger.kernel.org List-ID: Hello Minchan, On (11/25/16 17:35), Minchan Kim wrote: [..] > +static void zram_revalidate_disk(struct zram *zram) > +{ > + revalidate_disk(zram->disk); > + zram->disk->queue->backing_dev_info.capabilities |= > + BDI_CAP_STABLE_WRITES; > +} > + > /* > * Check if request is within bounds and aligned on zram logical blocks. > */ > @@ -1094,7 +1102,7 @@ static ssize_t disksize_store(struct device *dev, > zram->comp = comp; > zram->disksize = disksize; > set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT); > - revalidate_disk(zram->disk); > + zram_revalidate_disk(zram); > up_write(&zram->init_lock); > > return len; > @@ -1142,7 +1150,7 @@ static ssize_t reset_store(struct device *dev, > /* Make sure all the pending I/O are finished */ > fsync_bdev(bdev); > zram_reset_device(zram); > - revalidate_disk(zram->disk); > + zram_revalidate_disk(zram); > bdput(bdev); > > mutex_lock(&bdev->bd_mutex); why not set it just once, when we allocate queue/disk and configure both of them: in zram_add() queue->backing_dev_info.capabilities |= BDI_CAP_CGROUP_WRITEBACK; -ss