f2fs: fix wrong error hanlder in f2fs_follow_link
Subsystems (2)
Jaegeuk Kim
maintainerPATCH 1/1 f2fs: fix wrong error hanlder in f2fs_follow_link
The page_follow_link_light returns NULL and its error pointer was remained in nd->path.
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Jaegeuk Kim <[email protected]>
--- fs/f2fs/namei.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
fs/f2fs/namei.c +3 -5
@@ -298,16 +298,14 @@ fail:static void *f2fs_follow_link (struct dentry *dentry,struct nameidata *nd) { -struct page *page; +struct page *page =page_follow_link_light (dentry, nd); - page =page_follow_link_light (dentry, nd); -if (IS_ERR (page)) +if (IS_ERR_OR_NULL (page))return page;/* this is broken symlink case */ if (*nd_get_link (nd) ==0 ) { -kunmap (page); -page_cache_release (page); +page_put_link (dentry, nd, page);return ERR_PTR (-ENOENT ); }return page;
Signature · 9 lines
2.1.1 ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
Quoted 8 lines
-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Thursday, April 23, 2015 2:15 AM
To: [email protected]; [email protected]; [email protected]
Cc: Jaegeuk Kim
Subject: [f2fs-dev] [PATCH] f2fs: fix wrong error hanlder inf2fs_follow_link
Quoted 5 lines
The
page_follow_link_lightreturns NULL and its error pointer was remained innd->path.Reported-by Dan Carpenter <[email protected]>Signed-off-by Jaegeuk Kim <[email protected]>
Reviewed-by Chao Yu <[email protected]>