Skip to content

Commit 8eb4f09

Browse files
author
Andreas Gruenbacher
committed
gfs2: gfs2_create_inode error handling fix
JIRA: https://issues.redhat.com/browse/RHEL-88093 Upstream Status: https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git 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 <agruenba@redhat.com> (cherry picked from commit 3a45c0cc8004aa5b1f0dfad05fe44b0a136f024f)
1 parent 2fcd380 commit 8eb4f09

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
@@ -651,7 +651,8 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
651651
if (!IS_ERR(inode)) {
652652
if (S_ISDIR(inode->i_mode)) {
653653
iput(inode);
654-
inode = ERR_PTR(-EISDIR);
654+
inode = NULL;
655+
error = -EISDIR;
655656
goto fail_gunlock;
656657
}
657658
d_instantiate(dentry, inode);

0 commit comments

Comments
 (0)