Skip to contentSkip to conversation

ext4: increase wait time needed before reuse of deleted inode numbers

PATCH In review Theodore Ts'o 2 participants 2 messages Apr 14, 2020 – Apr 22, 2020 ext4 file system

lore
Share & tools
lore

Theodore Ts'o

author maintainer
#0 lore raw

PATCH 1/1 ext4: increase wait time needed before reuse of deleted inode numbers

Current wait times have proven to be too short to protect against inode reuses that lead to metadata inconsistencies.

Now that we will retry the inode allocation if we can't find any recently deleted inodes, it's a lot safer to increase the recently deleted time from 5 seconds to a minute.

Google-Bug-Id: 36602237

---
 fs/ext4/ialloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/ialloc.c +1 -1
index 9faaf32be5cc..4b8c9a9bdf0c 100644
@@ -662,7 +662,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent,
  * block has been written back to disk.  (Yes, these values are
  * somewhat arbitrary...)
  */
-#define RECENTCY_MIN	5
+#define RECENTCY_MIN	60
 #define RECENTCY_DIRTY	300
 
 static int recently_deleted(struct super_block *sb, ext4_group_t group, int ino)
Signature · 1 line
2.24.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Theodore Ts'o

Current wait times have proven to be too short to protect against inode reuses that lead to metadata inconsistencies.

Now that we will retry the inode allocation if we can't find any recently deleted inodes, it's a lot safer to increase the recently deleted time from 5 seconds to a minute.

Google-Bug-Id: 36602237

Looks good to me. You can add:

Honza

Quoted 20 lines
---
 fs/ext4/ialloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/ialloc.c +1 -1
index 9faaf32be5cc..4b8c9a9bdf0c 100644
@@ -662,7 +662,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent,
  * block has been written back to disk.  (Yes, these values are
  * somewhat arbitrary...)
  */
-#define RECENTCY_MIN	5
+#define RECENTCY_MIN	60
 #define RECENTCY_DIRTY	300
 
 static int recently_deleted(struct super_block *sb, ext4_group_t group, int ino)
Signature · 1 line
2.24.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR