Re: fsync, rename, O_ATOMIC/O_PONIES

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

 



On 2-3-2012 14:12, Christoph Hellwig wrote:
I'd like to ask:
- Is there a tool to log all unsafe operations?

What is an unsafe operation?  Anything that's dumb and might lose data?

For example

The possibilities are sheer endless.

And?

- What is the *right* way to update a file?

  fd = open(tmpfile, ...);
  write(fd, ...);  // or any other update
  fdatasync(fd);
  rename(tmpfile, realfile);

Argh, come on.
That's not real and it's not complete. tmpfile is undefined, errors aren't handled and you have lots of unlisted assumptions or regressions.

Olaf

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux