public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata?
@ 2005-02-11  7:59 Junfeng Yang
  2005-02-11 10:14 ` Andrew Morton
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Junfeng Yang @ 2005-02-11  7:59 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: mc


Hi,

We're working on a file system checker and have a question regarding what
sys_sync actually does.  It appears to us that sys_sync should sync both
data and metadata, and wait until both data and metadata hit the disk
before it returns.  Is this true for all the file systems (especially
ext2) for kernel 2.6.x?  I've gotten many "error" traces for ext2, where
directory entries are not flushed to disk after sys_sync.  In other words,
even if users do call sys_sync, a crash after sys_sync call can still
cause file losses.  Is this intended?

Thanks,
-Junfeng


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

* Re: [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata?
  2005-02-11  7:59 [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata? Junfeng Yang
@ 2005-02-11 10:14 ` Andrew Morton
  2005-02-11 12:44 ` Andi Kleen
  2005-02-11 13:17 ` Bartlomiej Zolnierkiewicz
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2005-02-11 10:14 UTC (permalink / raw)
  To: Junfeng Yang; +Cc: linux-kernel, mc

Junfeng Yang <yjf@stanford.edu> wrote:
>
> 
> Hi,
> 
> We're working on a file system checker and have a question regarding what
> sys_sync actually does.  It appears to us that sys_sync should sync both
> data and metadata, and wait until both data and metadata hit the disk
> before it returns.  Is this true for all the file systems (especially
> ext2) for kernel 2.6.x?

It should be.

>  I've gotten many "error" traces for ext2, where
> directory entries are not flushed to disk after sys_sync.

How?

>  In other words,
> even if users do call sys_sync, a crash after sys_sync call can still
> cause file losses.  Is this intended?

No.

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

* Re: [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata?
  2005-02-11  7:59 [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata? Junfeng Yang
  2005-02-11 10:14 ` Andrew Morton
@ 2005-02-11 12:44 ` Andi Kleen
  2005-02-11 13:17 ` Bartlomiej Zolnierkiewicz
  2 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2005-02-11 12:44 UTC (permalink / raw)
  To: Junfeng Yang; +Cc: mc, linux-kernel

Junfeng Yang <yjf@stanford.edu> writes:

> We're working on a file system checker and have a question regarding what
> sys_sync actually does.  It appears to us that sys_sync should sync both
> data and metadata, and wait until both data and metadata hit the disk
> before it returns.  Is this true for all the file systems (especially
> ext2) for kernel 2.6.x?  I've gotten many "error" traces for ext2, where
> directory entries are not flushed to disk after sys_sync.  In other words,
> even if users do call sys_sync, a crash after sys_sync call can still
> cause file losses.  Is this intended?

No, it would be a bug. sync() is supposed to flush everything.
In the ext2 case directory changes should be hold in a dirty buffer,
which sync should normally flush.

-Andi

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

* Re: [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata?
  2005-02-11  7:59 [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata? Junfeng Yang
  2005-02-11 10:14 ` Andrew Morton
  2005-02-11 12:44 ` Andi Kleen
@ 2005-02-11 13:17 ` Bartlomiej Zolnierkiewicz
  2 siblings, 0 replies; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-02-11 13:17 UTC (permalink / raw)
  To: Junfeng Yang; +Cc: Linux Kernel Mailing List, mc

Hi,

On Thu, 10 Feb 2005 23:59:53 -0800 (PST), Junfeng Yang <yjf@stanford.edu> wrote:
> 
> Hi,
> 
> We're working on a file system checker and have a question regarding what
> sys_sync actually does.  It appears to us that sys_sync should sync both
> data and metadata, and wait until both data and metadata hit the disk
> before it returns.  Is this true for all the file systems (especially
> ext2) for kernel 2.6.x?  I've gotten many "error" traces for ext2, where
> directory entries are not flushed to disk after sys_sync.  In other words,
> even if users do call sys_sync, a crash after sys_sync call can still
> cause file losses.  Is this intended?

I don't know what exactly you are doing but do you remember
about disabling write caching on your disks in case of doing
real hard crashes?

Regards,
Bartlomiej

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

end of thread, other threads:[~2005-02-11 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-11  7:59 [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata? Junfeng Yang
2005-02-11 10:14 ` Andrew Morton
2005-02-11 12:44 ` Andi Kleen
2005-02-11 13:17 ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox