Skip to content

Commit f979f59

Browse files
Andreas Gruenbachersmb49
authored andcommitted
gfs2: gfs2_create_inode error handling fix
BugLink: https://bugs.launchpad.net/bugs/2119603 [ Upstream commit af4044fd0b77e915736527dd83011e46e6415f01 ] When gfs2_create_inode() finds a directory, make sure to return -EISDIR. Fixes: 571a4b5 ("GFS2: bugger off early if O_CREAT open finds a directory") Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Mehmet Basaran <[email protected]>
1 parent 94ed811 commit f979f59

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/gfs2/inode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,8 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
659659
if (!IS_ERR(inode)) {
660660
if (S_ISDIR(inode->i_mode)) {
661661
iput(inode);
662-
inode = ERR_PTR(-EISDIR);
662+
inode = NULL;
663+
error = -EISDIR;
663664
goto fail_gunlock;
664665
}
665666
d_instantiate(dentry, inode);

0 commit comments

Comments
 (0)