mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[PATCH] hfs: don't dirty unchanged inode
If inode size hasn't changed, don't do anything further in truncate, which also prevents a dirty inode, what might upset some readonly devices quite badly. Signed-off-by: Roman Zippel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
0072b1389c
commit
f76d28d235
2 changed files with 5 additions and 2 deletions
|
|
@ -482,7 +482,8 @@ void hfs_file_truncate(struct inode *inode)
|
|||
page_cache_release(page);
|
||||
mark_inode_dirty(inode);
|
||||
return;
|
||||
}
|
||||
} else if (inode->i_size == HFS_I(inode)->phys_size)
|
||||
return;
|
||||
size = inode->i_size + HFS_SB(sb)->alloc_blksz - 1;
|
||||
blk_cnt = size / HFS_SB(sb)->alloc_blksz;
|
||||
alloc_cnt = HFS_I(inode)->alloc_blocks;
|
||||
|
|
|
|||
Loading…
Reference in a new issue