Skip to contentSkip to conversation

f2fs:set the correct place of initializing *res_page

PATCH Superseded Yuan Zhong 2 participants 2 messages Mar 7, 2015 – Mar 9, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yuan Zhong

author
#0 lore raw

PATCH 2/3 f2fs:set the correct place of initializing *res_page

The function 'find_in_inline_dir()' contain 'res_page' as an argument. So, we should initiaize 'res_page' before this function.

---
 fs/f2fs/dir.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/dir.c +2 -2
index 590aeef..a28909d 100644
@@ -219,14 +219,14 @@ struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
 	unsigned int max_depth;
 	unsigned int level;
 
+	*res_page = NULL;
+
 	if (f2fs_has_inline_dentry(dir))
 		return find_in_inline_dir(dir, child, res_page);
 
 	if (npages == 0)
 		return NULL;
 
-	*res_page = NULL;
-
 	name_hash = f2fs_dentry_hash(child);
 	max_depth = F2FS_I(dir)->i_current_depth;
 
Signature · 1 line
1.7.9.5
Reviewed-by on v1 2/3
#1 lore raw

Hi Yuan,

Quoted 11 lines

-----Original Message-----
From: Yuan Zhong [mailto:[email protected]]
Sent: Saturday, March 07, 2015 6:08 PM
To: Jaegeuk Kim
Cc: [email protected]; [email protected]; [email protected]
Subject: [f2fs-dev] [PATCH 2/3] f2fs:set the correct place of initializing *res_page

The function 'find_in_inline_dir()' contain 'res_page' as an argument. So, we should initiaize 'res_page' before this function.

It is missed by "inline dentry" feature, my bad.
Anyway, it should be corrected for avoiding potential bugs when changing codes.

Thank you.

Quoted 2 lines