linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Sergey Alexandrov <splavgm@gmail.com>,
	Vyacheslav Dubeyko <slava@dubeyko.com>,
	Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [ 10/26] nilfs2: fix fix very long mount time issue
Date: Thu,  7 Feb 2013 16:57:38 -0800	[thread overview]
Message-ID: <20130208004629.018301602@linuxfoundation.org> (raw)
In-Reply-To: <20130208004627.258272404@linuxfoundation.org>

3.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Vyacheslav Dubeyko <slava@dubeyko.com>

commit a9bae189542e71f91e61a4428adf6e5a7dfe8063 upstream.

There exists a 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=<file_name> 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 <splavgm@gmail.com>
Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Tested-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tested-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/nilfs2/ioctl.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -666,8 +666,11 @@ static int nilfs_ioctl_clean_segments(st
 	if (ret < 0)
 		printk(KERN_ERR "NILFS: GC failed during preparation: "
 			"cannot read source blocks: err=%d\n", ret);
-	else
+	else {
+		if (nilfs_sb_need_update(nilfs))
+			set_nilfs_discontinued(nilfs);
 		ret = nilfs_clean_segments(inode->i_sb, argv, kbufs);
+	}
 
 	nilfs_remove_all_gcinodes(nilfs);
 	clear_nilfs_gc_running(nilfs);



  parent reply	other threads:[~2013-02-08  1:06 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08  0:57 [ 00/26] 3.4.30-stable review Greg Kroah-Hartman
2013-02-08  0:57 ` [ 01/26] digsig: Fix memory leakage in digsig_verify_rsa() Greg Kroah-Hartman
2013-02-08  0:57 ` [ 02/26] drm/radeon/evergreen+: wait for the MC to settle after MC blackout Greg Kroah-Hartman
2013-02-08  0:57 ` [ 03/26] drm/radeon: add WAIT_UNTIL to the non-VM safe regs list for cayman/TN Greg Kroah-Hartman
2013-02-08  0:57 ` [ 04/26] drm/radeon: add quirk for RV100 board Greg Kroah-Hartman
2013-02-08  0:57 ` [ 05/26] drm/radeon: fix MC blackout on evergreen+ Greg Kroah-Hartman
2013-02-08  0:57 ` [ 06/26] drm/radeon: prevent crash in the ring space allocation Greg Kroah-Hartman
2013-02-08  0:57 ` [ 07/26] drm/radeon: Calling object_unrefer() when creating fb failure Greg Kroah-Hartman
2013-02-08  0:57 ` [ 08/26] x86-64: Replace left over sti/cli in ia32 audit exit code Greg Kroah-Hartman
2013-02-08  0:57 ` [ 09/26] sched/rt: Use root_domain of rt_rq not current processor Greg Kroah-Hartman
2013-02-08  0:57 ` Greg Kroah-Hartman [this message]
2013-02-08  0:57 ` [ 11/26] drivers/rtc/rtc-isl1208.c: call rtc_update_irq() from the alarm irq handler Greg Kroah-Hartman
2013-02-08  0:57 ` [ 12/26] USB: ftdi_sio: add Zolix FTDI PID Greg Kroah-Hartman
2013-02-08  0:57 ` [ 13/26] USB: ftdi_sio: add PID/VID entries for ELV WS 300 PC II Greg Kroah-Hartman
2013-02-08  0:57 ` [ 14/26] USB: option: add support for Telit LE920 Greg Kroah-Hartman
2013-02-08  0:57 ` [ 15/26] USB: option: add Changhong CH690 Greg Kroah-Hartman
2013-02-08  0:57 ` [ 16/26] USB: qcserial: add Telit Gobi QDL device Greg Kroah-Hartman
2013-02-08  0:57 ` [ 17/26] USB: EHCI: fix timer bug affecting port resume Greg Kroah-Hartman
2013-02-08  0:57 ` [ 18/26] USB: EHCI: fix bug in scheduling periodic split transfers Greg Kroah-Hartman
2013-02-08  0:57 ` [ 19/26] usb: Using correct way to clear usb3.0 devices remote wakeup feature Greg Kroah-Hartman
2013-02-08  0:57 ` [ 20/26] USB: storage: Define a new macro for USB storage match rules Greg Kroah-Hartman
2013-02-08  0:57 ` [ 21/26] USB: storage: optimize to match the Huawei USB storage devices and support new switch command Greg Kroah-Hartman
2013-02-08  0:57 ` [ 22/26] drivers: xhci: fix incorrect bit test Greg Kroah-Hartman
2013-02-08  0:57 ` [ 23/26] xhci: Fix isoc TD encoding Greg Kroah-Hartman
2013-02-08  0:57 ` [ 24/26] xhci: Fix TD size for isochronous URBs Greg Kroah-Hartman
2013-02-08  0:57 ` [ 25/26] USB: XHCI: fix memory leak of URB-private data Greg Kroah-Hartman
2013-02-08  0:57 ` [ 26/26] usb: Prevent dead ports when xhci is not enabled Greg Kroah-Hartman
2013-02-08 20:28 ` [ 00/26] 3.4.30-stable review Shuah Khan
2013-02-09 12:12 ` Satoru Takeuchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130208004629.018301602@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=konishi.ryusuke@lab.ntt.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=slava@dubeyko.com \
    --cc=splavgm@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).