mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 06:21:31 +00:00
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>
This commit is contained in:
parent
4034600516
commit
146bca72c7
5 changed files with 52 additions and 47 deletions
|
@ -111,6 +111,17 @@ struct extent_position {
|
|||
|
||||
/* super.c */
|
||||
extern void udf_warning(struct super_block *, const char *, const char *, ...);
|
||||
static inline void udf_updated_lvid(struct super_block *sb)
|
||||
{
|
||||
struct buffer_head *bh = UDF_SB(sb)->s_lvid_bh;
|
||||
|
||||
BUG_ON(!bh);
|
||||
WARN_ON_ONCE(((struct logicalVolIntegrityDesc *)
|
||||
bh->b_data)->integrityType !=
|
||||
cpu_to_le32(LVID_INTEGRITY_TYPE_OPEN));
|
||||
sb->s_dirt = 1;
|
||||
UDF_SB(sb)->s_lvid_dirty = 1;
|
||||
}
|
||||
|
||||
/* namei.c */
|
||||
extern int udf_write_fi(struct inode *inode, struct fileIdentDesc *,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue