Message ID | 20200304124918.16389-5-cascardo@canonical.com |
---|---|
State | New |
Headers | show |
Series | [X/B,1/2] do_last(): fetch directory ->i_mode and ->i_uid before it's too late | expand |
diff --git a/fs/namei.c b/fs/namei.c index 0bd1f2de6aa0..6a9b8aae2401 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3257,8 +3257,8 @@ static int do_last(struct nameidata *nd, struct file *file, const struct open_flags *op) { struct dentry *dir = nd->path.dentry; - kuid_t dir_uid = dir->d_inode->i_uid; - umode_t dir_mode = dir->d_inode->i_mode; + kuid_t dir_uid = nd->inode->i_uid; + umode_t dir_mode = nd->inode->i_mode; int open_flag = op->open_flag; bool will_truncate = (open_flag & O_TRUNC) != 0; bool got_write = false;