Re: [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata?

2005-02-11 Thread Bartlomiej Zolnierkiewicz
Hi,

On Thu, 10 Feb 2005 23:59:53 -0800 (PST), Junfeng Yang <[EMAIL PROTECTED]> 
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata?

2005-02-11 Thread Andi Kleen
Junfeng Yang <[EMAIL PROTECTED]> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata?

2005-02-11 Thread Andrew Morton
Junfeng Yang <[EMAIL PROTECTED]> 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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata?

2005-02-11 Thread Andrew Morton
Junfeng Yang [EMAIL PROTECTED] 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.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata?

2005-02-11 Thread Andi Kleen
Junfeng Yang [EMAIL PROTECTED] 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
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [CHECKER] Does sys_sync (ext2, 2.6.x) flush metadata?

2005-02-11 Thread Bartlomiej Zolnierkiewicz
Hi,

On Thu, 10 Feb 2005 23:59:53 -0800 (PST), Junfeng Yang [EMAIL PROTECTED] 
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
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/