Kbase P115366: How the HFS File System Modifies Files?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  4/19/2006 |
|
Status: Unverified
GOAL:
How the HFS File System Modifies Files?
GOAL:
How the High File Support System Modifies Files?
FACT(s) (Environment):
HP-UX
FIX:
Every time a file is modified, the HP-UX operating system updates the file system to ensure its consistency.
When a process updates (writes to) the file system, the data being written is copied into an in-memory buffer cache. The physical disk is updated asynchronously from the buffer write. The data, along with the inode information reflecting the change, is written to the disk sometime later, unless the file was opened in the synchronous mode (see the description of O_SYNC and O_SYNCIO in open(2) and fcntl(2) in the HP-UX Reference). The process continues, even though the data has not yet been written to the disk. If the system is halted without writing the buffer to disk, the file system on the disk is left in an inconsistent state. Such inconsistencies are flagged and corrected, if possible, by the fsck command at system startup. (Discussions of fsck, the file-system check command, appear later in this chapter, in Solving HP-UX Problems, and in fsck(1M) of the HP-UX Reference Manual.)
The sync command can be used to force synchronization. However, the syncer command routinely updates the file system's superblock, inodes, data blocks, and cylinder group information, as described below.
(For further information, see sync(1M) and syncer(1M) in HP-UX Reference Manual.)
Primary Superblock
The superblock of a mounted file system is written to the disk whenever a umount command is issued, or when a sync command is issued and the file system has been modified.
Inodes
An inode contains information describing the file. The inode is written to disk after every modification, unless the fs_async parameter is set in the configuration (S800 or dfile) file.
Data blocks
In-core blocks (including directories, indirect blocks, files, pipes, symbolic links, and FIFOs) are written to the file system after being modified and released by the operating system. Upon release, data blocks are buffered or queued for eventual writing. Physical I/O takes place when the buffer is needed by HP-UX, when a sync or fsync command is issued, or when O_SYNC is set for the file. If a file is opened with the O_SYNC or O_SYNCIO flag set, the write system call does not return until completed.
Cylinder group
The cylinder group information is updated whenever a sync is executed, or when the system needs a buffer and the cylinder group is written.