aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs
diff options
context:
space:
mode:
authorJoern Engel <joern@logfs.org>2010-05-01 11:00:34 -0400
committerJoern Engel <joern@logfs.org>2010-05-01 12:02:34 -0400
commitccc0197b02178f7e1707e659cbc5242fc94b499a (patch)
tree6cba753c7e2c480123856275fb06845d86ac5a44 /fs/logfs
parentbd2b3f29594c50d7c5bd864d9af05d440394ee82 (diff)
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>
Diffstat (limited to 'fs/logfs')
-rw-r--r--fs/logfs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/logfs/inode.c b/fs/logfs/inode.c
index 14ed27274da2..45bf86f1595a 100644
--- a/fs/logfs/inode.c
+++ b/fs/logfs/inode.c
@@ -326,7 +326,7 @@ static void logfs_set_ino_generation(struct super_block *sb,
326 u64 ino; 326 u64 ino;
327 327
328 mutex_lock(&super->s_journal_mutex); 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 super->s_last_ino = ino; 330 super->s_last_ino = ino;
331 super->s_inos_till_wrap--; 331 super->s_inos_till_wrap--;
332 if (super->s_inos_till_wrap < 0) { 332 if (super->s_inos_till_wrap < 0) {