public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Ewan Chalmers <ewan.chalmers@gmail.com>
Cc: xfs@oss.sgi.com
Subject: Re: Does XFS support the sync mount option?
Date: Sat, 7 Feb 2009 10:05:02 +1100	[thread overview]
Message-ID: <20090206230502.GQ24173@disturbed> (raw)
In-Reply-To: <884979c90902050643m78d2e0dbt85aa7f4369e243ef@mail.gmail.com>

On Thu, Feb 05, 2009 at 02:43:29PM +0000, Ewan Chalmers wrote:
> I am interested to know whether XFS supports the sync mount option.

Yes.

> I am using XFS on an external USB disk and automounting using the
> ubuntu/debian usbmount package
> (http://packages.ubuntu.com/intrepid/usbmount). The disk is connected
> to a headless server. I would like to be able to safely switch the
> disk on/off on demand without first logging in to the box to
> sync/unmount. I believe the sync option is essential to this use case.
> Using usbmount, it appears to work correctly, but the output to syslog
> makes me wonder.

You've pulled the plug on the block device, and you wonder why the
filesystem detects an IO error and shutѕ down? XFS is designed to protect
itself when something goes wrong with the underlying device.
Every time you switch off the drive you'll get these errors.

And "sync" only works if you turn drive write caches off or have
barriers enabled. There are many people out there that  have systems
that are suseptible to fatal filesystem corruption that could be
triggered by doing this (because critical metadata is lost from
the volatile write cache on the drive when you power it off).

> The default configuration for usbmount includes
> 
> FILESYSTEMS="ext2 ext3"
> MOUNTOPTIONS="sync,noexec,nodev,noatime"

Oh, that might explain why kerneloops records so many crashes in
ext2/3 from people pulling the plug on USB drives...

> I have added xfs to the FILESYSTEMS list.

Please don't. I don't want to have to deal with all the shutdowns
and corrupted filesystem reports that this will result in.

> On switching off the disk, I see the following output in syslog
>
> kernel: [1034259.923629] usb 1-2: USB disconnect, address 26
> kernel: [1034259.936251] xfs_force_shutdown(sdb1,0x1) called from line
> 420 of file /build/buildd/linux-2.6.27/fs/xfs/xfs_rw.c.  Return
> address = 0xe0a9ddb4
> kernel: [1034259.936334] Filesystem "sdb1": I/O Error Detected.
> Shutting down filesystem: sdb1
....
> But the disk remounts cleanly when it is switched back on.

That doesn't mean it hasn't been corrupted. Only an offline
check/repair will tell you that.

> I would be interested to know whether it is reasonable to use XFS in
> the way I have outlined.

No, it's not really a reasonable way to use any filesystem.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2009-02-06 23:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-05 14:43 Does XFS support the sync mount option? Ewan Chalmers
2009-02-06 23:05 ` Dave Chinner [this message]
2009-02-09  8:34   ` Michael Monnerie
2009-02-12 23:46   ` Ewan Chalmers
2009-02-13  0:39     ` Eric Sandeen

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=20090206230502.GQ24173@disturbed \
    --to=david@fromorbit.com \
    --cc=ewan.chalmers@gmail.com \
    --cc=xfs@oss.sgi.com \
    /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