Re: Transaction ordering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Apr 29, 2004  13:10 -0600, Bruce Guenter wrote:
> If I issue the following sequence of pseudo-syscalls:
> 
> 	fd = open(temp_file, O_WRONLY)
> 	write(fd)
> 	rename(temp_file, dest_file)
> 	fsync(fd)
> 	close(fd)
> (where dest_file is in a different directory)
> 
> Does ext3 order the commit such that the file write effectively happens
> in the journal before the rename?  That is, is there any chance that, if
> a crash occurred, that the destination directory would contain a link to
> an incompletely written file?

If you require such ordering, put the fsync before the rename.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/


_______________________________________________

Ext3-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/ext3-users

[Index of Archives]         [Linux RAID]     [Kernel Development]     [Red Hat Install]     [Video 4 Linux]     [Postgresql]     [Fedora]     [Gimp]     [Yosemite News]

  Powered by Linux