Skip to content

Commit

Permalink
gfs2_atomic_open(): fix O_EXCL|O_CREAT handling on cold dcache
Browse files Browse the repository at this point in the history
with the way fs/namei.c:do_last() had been done, ->atomic_open()
instances needed to recognize the case when existing file got
found with O_EXCL|O_CREAT, either by falling back to finish_no_open()
or failing themselves.  gfs2 one didn't.

Fixes: 6d4ade9 (GFS2: Add atomic_open support)
Cc: [email protected] # v3.11
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Mar 12, 2020
1 parent bf4498a commit 2103913
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,
if (!(file->f_mode & FMODE_OPENED))
return finish_no_open(file, d);
dput(d);
return 0;
return excl && (flags & O_CREAT) ? -EEXIST : 0;
}

BUG_ON(d != NULL);
Expand Down

0 comments on commit 2103913

Please sign in to comment.