Re: fsync, ext2 on Linux

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: fsync, ext2 on Linux
Дата
Msg-id 27660.1099235701@sss.pgh.pa.us
обсуждение исходный текст
Ответ на fsync, ext2 on Linux  (Heikki Linnakangas <hlinnaka@iki.fi>)
Ответы Re: fsync, ext2 on Linux  (Andrew Dunstan <andrew@dunslane.net>)
Re: fsync, ext2 on Linux  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: fsync, ext2 on Linux  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-hackers
Heikki Linnakangas <hlinnaka@iki.fi> writes:
> The Linux [ext2] fsync man page says:
> "It does not necessarily ensure that the entry in the directory 
> containing the file has also reached disk. For that an explicit fsync on 
> the file descriptor of the directory is also needed."

This seems so broken as to defy belief.  A process creating a file
doesn't normally *have* a file descriptor for the parent directory,
and I don't think the concept of an FD for a directory is even
portable (opendir() certainly doesn't return an FD).  One might also
ask if we are expected to fsync everything up to the root in order
to be sure that the file remains accessible, and how exactly we should
do that on directories we don't have write access for.

In general we expect the filesystem to take care of its own metadata.
Run ext3 in journaling mode, or something like that.

(It occurs to me that the admin guide really ought to have a few words
about recommended and non-recommended filesystems ...)
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Version defines
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: fsync, ext2 on Linux