From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756740Ab3ANXhi (ORCPT ); Mon, 14 Jan 2013 18:37:38 -0500 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]:51432 "EHLO tama500.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752679Ab3ANXhg (ORCPT ); Mon, 14 Jan 2013 18:37:36 -0500 Message-Id: <201301142338.AA04488@capsicum.lab.ntt.co.jp> From: Ryusuke Konishi Date: Tue, 15 Jan 2013 08:38:09 +0900 To: Andrew Morton Cc: slava@dubeyko.com, splavgm@gmail.com, linux-nilfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nilfs2: fix very long mount time issue In-Reply-To: <20130114150041.d57e5e03.akpm@linux-foundation.org> References: <20130114150041.d57e5e03.akpm@linux-foundation.org> MIME-Version: 1.0 X-Mailer: AL-Mail32 Version 1.13 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >On Sun, 13 Jan 2013 16:07:23 +0900 (JST) >Ryusuke Konishi wrote: > >> On Sat, 12 Jan 2013 19:34:48 +0400, Vyacheslav Dubeyko wrote: >> > From: Vyacheslav Dubeyko >> > Subject: [PATCH] nilfs2: fix very long mount time issue >> > >> > DESCRIPTION: >> > It exists situation when GC can work in background alone without any other filesystem activity during significant time. The nilfs_clean_segments() method calls nilfs_segctor_construct() that updates superblocks in the case of NILFS_SC_SUPER_ROOT and THE_NILFS_DISCONTINUED flags are set. But when GC is working alone the nilfs_clean_segments() is called with unset THE_NILFS_DISCONTINUED flag. As a result, the update of superblocks doesn't occurred all this time and in the case of SPOR superblocks keep very old values of last super root placement. >> > >> > SYMPTOMS: >> > Trying to mount a NILFS2 volume after SPOR in such environment ends with very long mounting time (it can achieve about several hours in some cases). >> > >> > REPRODUCING PATH: >> > 1. It needs to use external USB HDD, disable automount and doesn't make any additional filesystem activity on the NILFS2 volume. >> > 2. Generate temporary file with size about 100 - 500 GB (for example, dd if=/dev/zero of= bs=1073741824 count=200). The size of file defines duration of GC working. >> > 3. Then it needs to delete file. >> > 4. Start GC manually by means of command "nilfs-clean -p 0". When you start GC by means of such way then, at the end, superblocks is updated by once. So, for simulation of SPOR, it needs to wait sometime (15 - 40 minutes) and simply switch off USB HDD manually. >> > 5. Switch on USB HDD again and try to mount NILFS2 volume. As a result, NILFS2 volume will mount during very long time. >> > >> > REPRODUCIBILITY: 100% >> > >> > FIX: >> > This patch adds checking that superblocks need to update and set THE_NILFS_DISCONTINUED flag before nilfs_clean_segments() call. >> > >> > Reported-by: Sergey Alexandrov >> > Signed-off-by: Vyacheslav Dubeyko >> > Tested-by: Vyacheslav Dubeyko >> >> Acked-by: Ryusuke Konishi >> >> Thanks, Vyacheslav. I confirmed the issue and could reproduce it. >> Your patch fixed it. >> >> Andrew, please apply. > >I added a Cc:stable so the fix will be backported into earlier kernels. >40 minutes mount time is pretty bad! Yup, I agree. Thanks. Ryusuke Konishi