On Wed, Oct 29, 2003 at 06:06:54PM -0600, Vijayan Prabhakaran
wrote:> Hi,
>
> I have a doubt on how the transaction semantics work in ext3.
>
> When I copy a file, does the entire copy is treated as one
> transaction so that finally I have either the full file or
> no file. Or will it be split into multiple transactions which
> can result in copying partial files.
The latter. Transactions inside ext3 are strictly for the
filesystem's own use. If the application needs or wishes assure
application-level transactions, it needs to provide it itself. This
is true for pretty much all Unix filesystems, and is certainly true of
xfs, jfs, as well as ext3.
If you want to guarantee that something is on disk, you need to use
the fsync() system call after you copy the file.
- Ted