linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] disable queue flag test in barrier check
@ 2008-06-26  3:07 Eric Sandeen
  2008-06-26  8:25 ` Timothy Shimmin
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2008-06-26  3:07 UTC (permalink / raw)
  To: xfs-oss; +Cc: LinuxRaid

md raid1 can pass down barriers, but does not set an ordered flag 
on the queue, so xfs does not even attempt a barrier write, and 
will never use barriers on these block devices.

I propose removing the flag check and just let the barrier write
test determine barrier support.

The risk here, I suppose, is that if something does not set an ordered
flag and also does not properly return an error on a barrier write...
but if it's any consolation jbd/ext3/reiserfs never test the flag, 
and don't even do a test write, they just disable barriers the first 
time an actual journal barrier write fails.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

Index: linux-2.6.25.1/fs/xfs/linux-2.6/xfs_super.c
===================================================================
--- linux-2.6.25.1.orig/fs/xfs/linux-2.6/xfs_super.c
+++ linux-2.6.25.1/fs/xfs/linux-2.6/xfs_super.c
@@ -733,14 +733,6 @@ xfs_mountfs_check_barriers(xfs_mount_t *
 		return;
 	}
 
-	if (mp->m_ddev_targp->bt_bdev->bd_disk->queue->ordered ==
-					QUEUE_ORDERED_NONE) {
-		xfs_fs_cmn_err(CE_NOTE, mp,
-		  "Disabling barriers, not supported by the underlying device");
-		mp->m_flags &= ~XFS_MOUNT_BARRIER;
-		return;
-	}
-
 	if (xfs_readonly_buftarg(mp->m_ddev_targp)) {
 		xfs_fs_cmn_err(CE_NOTE, mp,
 		  "Disabling barriers, underlying device is readonly");



^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [PATCH] disable queue flag test in barrier check
@ 2008-06-26 15:24 David Lethe
  0 siblings, 0 replies; 7+ messages in thread
From: David Lethe @ 2008-06-26 15:24 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Timothy Shimmin, xfs-oss, LinuxRaid, NeilBrown, jeremy

Unflushed writes are 100% effective for losing data and corrupting file systems.  Data isn't saved until it is on the magnetic media.  Batterybackup modules for disk controllers help, but there is no substitute for a ups.  Even with a bbu on disk controller, if the kernel hasn't flushed write to the controller, and system crashes or loses power, the kernel io queue will never reach the controllers bbu.

You have a moral obligation to use a ups... And if you work for a US company, then Sarbox pretty much makes this a legal obligation and a criminal offense if you don't protect certain databases with something as reasonable and cheap as a ups

-----Original Message-----

From:  "Eric Sandeen" <sandeen@sandeen.net>
Subj:  Re: [PATCH] disable queue flag test in barrier check
Date:  Thu Jun 26, 2008 9:57 am
Size:  1K
To:  "David Lethe" <david@santools.com>
cc:  "Timothy Shimmin" <tes@sgi.com>; "xfs-oss" <xfs@oss.sgi.com>; "LinuxRaid" <linux-raid@vger.kernel.org>; "NeilBrown" <neilb@suse.de>; "jeremy@sgi.comwe" <jeremy@sgi.comwe>

David Lethe wrote: 
> Fyi - related problem is seen with solaris & zfs when users attach them 
> to hardware-based RAID subsystems.  The vendors had 
> to make firmware tweaks to address solaris's 
> flush-to-disk-after-all-writes.   
>  
> Not sure what you mean about non-volatile vs. volatile write cache, 
> however.  If you want to see if write cache is enabled on a disk drive, 
> or  
> Even a logical disk on a hardware-based RAId, under Linux, then google 
> "mode page editor" for lots of choices.  Also look up zfs write cache 
> raid and you'll get information that you can just as easily apply to 
> Linux implementations of md.  
 
I'm not so interested in whether it is enabled; I'd like to know if it 
is safe (to varying degrees) in the event of a power failure, and I 
don't think there's any way we can know that. 
 
So the administrator, if she's sure that all cached writes will hit disk 
even if a breaker pops, can disable barriers.  If it's just a 32MB cache 
seagate drive plugged  into the wall, you probably had better be sure 
barriers are enabled or you may well have a scrambled filesystem 
post-power-outage. 
 
-Eric 
 



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-06-27  4:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-26  3:07 [PATCH] disable queue flag test in barrier check Eric Sandeen
2008-06-26  8:25 ` Timothy Shimmin
2008-06-26 13:25   ` Eric Sandeen
2008-06-26 14:47     ` David Lethe
2008-06-26 14:57       ` Eric Sandeen
2008-06-27  4:51     ` Timothy Shimmin
  -- strict thread matches above, loose matches on Subject: below --
2008-06-26 15:24 David Lethe

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).