Skip to contentSkip to conversation

missing journal_stop in ext4_da_write_begin error case

PATCH In review Eric Sandeen 2 participants 2 messages Jul 31, 2008 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 missing journal_stop in ext4_da_write_begin error case

ext4_da_write_begin needs to call journal_stop before returning, if the page allocation fails.

---

fs/ext4/inode.c +5 -2
Index: linux-2.6/fs/ext4/inode.c
===================================================================
@@ -2280,8 +2280,11 @@ retry:
 	}
 
 	page = __grab_cache_page(mapping, index);
-	if (!page)
-		return -ENOMEM;
+	if (!page) {
+		ext4_journal_stop(handle);
+		ret = -ENOMEM;
+		goto out;
+	}
 	*pagep = page;
 
 	ret = block_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
#1 lore raw
Quoted 4 lines · 在 2008-07-31四的 12:23 -0500,Eric Sandeen写道:

ext4_da_write_begin needs to call journal_stop before returning, if the page allocation fails.

Quoted 22 lines

---

Index: linux-2.6/fs/ext4/inode.c
===================================================================

fs/ext4/inode.c +5 -3
@@ -2280,8 +2280,11 @@ retry:
 	}
 
 	page = __grab_cache_page(mapping, index);
-	if (!page)
-		return -ENOMEM;
+	if (!page) {
+		ext4_journal_stop(handle);
+		ret = -ENOMEM;
+		goto out;
+	}
 	*pagep = page;
 
 	ret = block_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html