Commit ccc0197b02178f7e1707e659cbc5242fc94b499a

Authored by Joern Engel
1 parent bd2b3f2959

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: Joern Engel <joern@logfs.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -326,7 +326,7 @@
326 326 u64 ino;
327 327  
328 328 mutex_lock(&super->s_journal_mutex);
329   - ino = logfs_seek_hole(super->s_master_inode, super->s_last_ino);
  329 + ino = logfs_seek_hole(super->s_master_inode, super->s_last_ino + 1);
330 330 super->s_last_ino = ino;
331 331 super->s_inos_till_wrap--;
332 332 if (super->s_inos_till_wrap < 0) {