From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753216Ab2ITABV (ORCPT ); Wed, 19 Sep 2012 20:01:21 -0400 Received: from li9-11.members.linode.com ([67.18.176.11]:51641 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752982Ab2ITABU (ORCPT ); Wed, 19 Sep 2012 20:01:20 -0400 Date: Wed, 19 Sep 2012 20:01:10 -0400 From: "Theodore Ts'o" To: Pavel Machek Cc: Matt Sealey , Mike Thompson , Shawn Guo , Linux-Arm-Kernel , linux-ext4@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Tracking down suspend/resume ext3/mmc issues on imx233 Message-ID: <20120920000110.GA16672@thunk.org> Mail-Followup-To: Theodore Ts'o , Pavel Machek , Matt Sealey , Mike Thompson , Shawn Guo , Linux-Arm-Kernel , linux-ext4@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20120907060552.GL26709@S2101-09.ap.freescale.net> <20120910163345.GB3942@thunk.org> <20120919232349.GA24132@elf.ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120919232349.GA24132@elf.ucw.cz> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 20, 2012 at 01:23:49AM +0200, Pavel Machek wrote: > > I'm not sure I agree. > > If you treat root fs as removable, you'll get "crash". You'll need to > replay the journal, but data is safe. > > If you treat it as non-removable, and someone manages to remove it, > mount, and reinsert, you'll get silent data corruption. We could detect this case; if the file system gets mounted, the last mount time will change. So one of the things we could do is have the file system code freeze the file system at suspend time, so the file system is consistent (which will reduce the probability of data loss if the system never comes back up after the suspend), and save the last mount time and last write time in memory. When the system comes back from resume, have the file system code check the last mount and last write time, and if they have changed, it can refuse the resume and abort the system to avoid data corruption. It would require making ext3/ext4 suspend-aware, but it would be doable, if we really wanted to support this. - Ted