Skip to content

Commit 5cd9865

Browse files
Andreas Gruenbachergregkh
authored andcommitted
gfs2: gfs2_create_inode error handling fix
[ Upstream commit af4044f ] 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]>
1 parent 271e6bf commit 5cd9865

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)