diff options
author | Jan Kara <jack@suse.cz> | 2009-03-16 13:27:37 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2009-04-02 07:36:28 -0400 |
commit | 146bca72c7e6ba52de82a63b1fce7934dc103dbc (patch) | |
tree | fee0aff001a5d5226518f0b67232f083f0931209 /fs/udf/ialloc.c | |
parent | 40346005166329bc4b53e0c564aff3968c1ddaa0 (diff) |
udf: Don't write integrity descriptor too often
We update information in logical volume integrity descriptor after each
allocation (as LVID contains free space, number of directories and files on
disk etc.). If the filesystem is on some phase change media, this leads to its
quick degradation as such media is able to handle only 10000 overwrites or so.
We solve the problem by writing new information into LVID only on umount,
remount-ro and sync. This solves the problem at the price of longer media
inconsistency (previously media became consistent after pdflush flushed dirty
LVID buffer) but that should be acceptable.
Report by and patch written in cooperation with
Rich Coe <Richard.Coe@med.ge.com>.
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/ialloc.c')
-rw-r--r-- | fs/udf/ialloc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index 6eb279d5f4fb..c10fa39f97e2 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c | |||
@@ -49,8 +49,7 @@ void udf_free_inode(struct inode *inode) | |||
49 | le32_add_cpu(&lvidiu->numDirs, -1); | 49 | le32_add_cpu(&lvidiu->numDirs, -1); |
50 | else | 50 | else |
51 | le32_add_cpu(&lvidiu->numFiles, -1); | 51 | le32_add_cpu(&lvidiu->numFiles, -1); |
52 | 52 | udf_updated_lvid(sb); | |
53 | mark_buffer_dirty(sbi->s_lvid_bh); | ||
54 | } | 53 | } |
55 | mutex_unlock(&sbi->s_alloc_mutex); | 54 | mutex_unlock(&sbi->s_alloc_mutex); |
56 | 55 | ||
@@ -122,7 +121,7 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err) | |||
122 | if (!(++uniqueID & 0x00000000FFFFFFFFUL)) | 121 | if (!(++uniqueID & 0x00000000FFFFFFFFUL)) |
123 | uniqueID += 16; | 122 | uniqueID += 16; |
124 | lvhd->uniqueID = cpu_to_le64(uniqueID); | 123 | lvhd->uniqueID = cpu_to_le64(uniqueID); |
125 | mark_buffer_dirty(sbi->s_lvid_bh); | 124 | udf_updated_lvid(sb); |
126 | } | 125 | } |
127 | mutex_unlock(&sbi->s_alloc_mutex); | 126 | mutex_unlock(&sbi->s_alloc_mutex); |
128 | inode->i_mode = mode; | 127 | inode->i_mode = mode; |