提交 ccc0197b 编写于 作者: J Joern Engel

logfs: Close i_ino reuse race

logfs_seek_hole() may return the same offset it is passed as argument.
Found by Prasad Joshi <prasadjoshi124@gmail.com>
Signed-off-by: NJoern Engel <joern@logfs.org>
上级 bd2b3f29
...@@ -326,7 +326,7 @@ static void logfs_set_ino_generation(struct super_block *sb, ...@@ -326,7 +326,7 @@ static void logfs_set_ino_generation(struct super_block *sb,
u64 ino; u64 ino;
mutex_lock(&super->s_journal_mutex); mutex_lock(&super->s_journal_mutex);
ino = logfs_seek_hole(super->s_master_inode, super->s_last_ino); ino = logfs_seek_hole(super->s_master_inode, super->s_last_ino + 1);
super->s_last_ino = ino; super->s_last_ino = ino;
super->s_inos_till_wrap--; super->s_inos_till_wrap--;
if (super->s_inos_till_wrap < 0) { if (super->s_inos_till_wrap < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册