From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Snitzer Subject: Re: dm-bufio: break out of both loops when freeing data Date: Wed, 1 Oct 2014 14:42:31 -0400 Message-ID: <20141001184231.GA13947@redhat.com> References: Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Mikulas Patocka Cc: dm-devel@redhat.com, Edward Thornber , "Alasdair G. Kergon" List-Id: dm-devel.ids On Wed, Oct 01 2014 at 1:35pm -0400, Mikulas Patocka wrote: > > > On Wed, 1 Oct 2014, Mikulas Patocka wrote: > > > When we free the required number of entries (nr_to_scan becomes zero), we > > must break out of both loops. The code exited only the inner loop and > > continued in the outer loop. > > > > Also, move dm_bufio_cond_resched to the inner loop, so that scanning the > > list doesn't result in scheduling latency. > > > > Signed-off-by: Mikulas Patocka > > I forgot to add: > > Cc: stable@vger.kernel.org # 3.2+ I tweaked the header, used a return rather than goto, and staged in linux-next for 3.18. See: https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=04c308f43a90a9b3b84c344b324d6af29288da05