diff --git a/fs/namei.c b/fs/namei.c index 2aad8042a05bf10017cf13a8aff35f1f921a16d9..c00a7e1da4c0cd7d6dd2fa836574111056dc5194 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3259,8 +3259,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;