'auto_da_alloc'에 해당되는 글 1건

  1. 2013.11.25 [EXT4] noauto_da_alloc 옵션에 대해서
리눅스2013. 11. 25. 08:17

ext4 파일 시스템에 대한 커널 documentation에는 noauto_da_alloc에 대해서 다음과 같이 기술하고 있다.


auto_da_alloc(*)	Many broken applications don't use fsync() when 
noauto_da_alloc		replacing existing files via patterns such as
			fd = open("foo.new")/write(fd,..)/close(fd)/
			rename("foo.new", "foo"), or worse yet,
			fd = open("foo", O_TRUNC)/write(fd,..)/close(fd).
			If auto_da_alloc is enabled, ext4 will detect
			the replace-via-rename and replace-via-truncate
			patterns and force that any delayed allocation
			blocks are allocated such that at the next
			journal commit, in the default data=ordered
			mode, the data blocks of the new file are forced
			to disk before the rename() operation is
			committed.  This provides roughly the same level
			of guarantees as ext3, and avoids the
			"zero-length" problem that can happen when a
			system crashes before the delayed allocation
			blocks are forced to disk.


쉽게 풀어 얘기하자면, rename혹은 truncate같은 operation을 fsync()없이 행했을 경우, auto_da_alloc이 켜져 있으면 data=ordered 모드일 때, 다음 journal commit 시에 강제로 delayed 된 allocation 블럭들을 allocate 한다는 얘기다. (말이 쉽게 풀어 얘기지, 그냥 번역이네..)


따라서 ext3에 있던 "zero-length" 문제(delayed alloction 블럭이 disk에 쓰여지기 전에 시스템이 crash되는 문제)를 해결 할 수 있다.


noauto_da_alloc은 위와 같은 옵션을 꺼버리는 것이다.  이는 퍼포먼스 향상을 가져오지만 위에서 서술한 이점에 대해서는 포기하게 되는 것이다.

Posted by code cat