logfs: Close i_ino reuse race
authorJoern Engel <joern@logfs.org>
Sat, 1 May 2010 15:00:34 +0000 (17:00 +0200)
committerJoern Engel <joern@logfs.org>
Sat, 1 May 2010 16:02:34 +0000 (18:02 +0200)
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>
fs/logfs/inode.c

index 14ed27274da26954bcc451bfb022aa92e0761aa7..45bf86f1595aff49b71c553e12cff5e449031e48 100644 (file)
@@ -326,7 +326,7 @@ static void logfs_set_ino_generation(struct super_block *sb,
        u64 ino;
 
        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_inos_till_wrap--;
        if (super->s_inos_till_wrap < 0) {