提交 e83db167 编写于 作者: M Miklos Szeredi 提交者: Al Viro

vfs: do_last(): clean up labels

Reported-by: NDavid Howells <dhowells@redhat.com>
Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 aa4caadb
...@@ -2463,13 +2463,13 @@ static struct file *do_last(struct nameidata *nd, struct path *path, ...@@ -2463,13 +2463,13 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
error = -EISDIR; error = -EISDIR;
goto exit; goto exit;
} }
goto ok; goto finish_open;
case LAST_BIND: case LAST_BIND:
error = complete_walk(nd); error = complete_walk(nd);
if (error) if (error)
return ERR_PTR(error); return ERR_PTR(error);
audit_inode(pathname, dir); audit_inode(pathname, dir);
goto ok; goto finish_open;
} }
if (!(open_flag & O_CREAT)) { if (!(open_flag & O_CREAT)) {
...@@ -2526,7 +2526,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path, ...@@ -2526,7 +2526,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
will_truncate = 0; will_truncate = 0;
acc_mode = MAY_OPEN; acc_mode = MAY_OPEN;
path_to_nameidata(path, nd); path_to_nameidata(path, nd);
goto common; goto finish_open_created;
} }
/* /*
...@@ -2598,7 +2598,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path, ...@@ -2598,7 +2598,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
if ((nd->flags & LOOKUP_DIRECTORY) && !nd->inode->i_op->lookup) if ((nd->flags & LOOKUP_DIRECTORY) && !nd->inode->i_op->lookup)
goto exit; goto exit;
audit_inode(pathname, nd->path.dentry); audit_inode(pathname, nd->path.dentry);
ok: finish_open:
if (!S_ISREG(nd->inode->i_mode)) if (!S_ISREG(nd->inode->i_mode))
will_truncate = 0; will_truncate = 0;
...@@ -2608,7 +2608,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path, ...@@ -2608,7 +2608,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
goto exit; goto exit;
want_write = 1; want_write = 1;
} }
common: finish_open_created:
error = may_open(&nd->path, acc_mode, open_flag); error = may_open(&nd->path, acc_mode, open_flag);
if (error) if (error)
goto exit; goto exit;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册