Skip to contentSkip to conversation

ext4: initialize retries variable in ext4_da_write_inline_data_begin()

PATCH Applied Lukas Czerner 2 participants 2 messages Sep 26, 2018 – Oct 3, 2018 2 messages not in the archive

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
Quoted 5 lines · Jan Kara
Quoted 4 lines · Lukas Czerner

Variable retries is not initialized in ext4_da_write_inline_data_begin() which can lead to nondeterministic number of retries in case we hit ENOSPC. Initialize retries to zero as we do everywhere else.

Quoted 8 lines
Quoted 6 lines
Fixes bc0ca9df3b2a ("ext4: retry allocation when inline->extent conversion failed")
---
 fs/ext4/inline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Ted, this seems to have fallen through the cracks...

Yeah it did, Ted can you pick this up ?

-Lukas

Quoted 23 lines

Honza

Quoted 17 lines
fs/ext4/inline.c +1 -1
index 3543fe80a3c4..1b13fa5c9d6e 100644
@@ -863,7 +863,7 @@ int ext4_da_write_inline_data_begin(struct address_space *mapping,
 	handle_t *handle;
 	struct page *page;
 	struct ext4_iloc iloc;
-	int retries;
+	int retries = 0;
 
 	ret = ext4_get_inode_loc(inode, &iloc);
 	if (ret)
Signature · 1 line
2.17.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#3 lore raw
In reply to a message not in the archive
Quoted 7 lines · Lukas Czerner

Variable retries is not initialized in ext4_da_write_inline_data_begin() which can lead to nondeterministic number of retries in case we hit ENOSPC. Initialize retries to zero as we do everywhere else.

Fixes bc0ca9df3b2a ("ext4: retry allocation when inline->extent conversion failed")

Applied, thanks.

- Ted