--- zzzz-none-000/linux-3.10.107/drivers/base/devtmpfs.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/base/devtmpfs.c 2021-02-04 17:41:59.000000000 +0000 @@ -157,10 +157,10 @@ if (IS_ERR(dentry)) return PTR_ERR(dentry); - err = vfs_mkdir(path.dentry->d_inode, dentry, mode); + err = vfs_mkdir(d_inode(path.dentry), dentry, mode); if (!err) /* mark as kernel-created inode */ - dentry->d_inode->i_private = &thread; + d_inode(dentry)->i_private = &thread; done_path_create(&path, dentry); return err; } @@ -207,7 +207,7 @@ if (IS_ERR(dentry)) return PTR_ERR(dentry); - err = vfs_mknod(path.dentry->d_inode, dentry, mode, dev->devt); + err = vfs_mknod(d_inode(path.dentry), dentry, mode, dev->devt); if (!err) { struct iattr newattrs; @@ -215,12 +215,12 @@ newattrs.ia_uid = uid; newattrs.ia_gid = gid; newattrs.ia_valid = ATTR_MODE|ATTR_UID|ATTR_GID; - mutex_lock(&dentry->d_inode->i_mutex); - notify_change(dentry, &newattrs); - mutex_unlock(&dentry->d_inode->i_mutex); + mutex_lock(&d_inode(dentry)->i_mutex); + notify_change(dentry, &newattrs, NULL); + mutex_unlock(&d_inode(dentry)->i_mutex); /* mark as kernel-created inode */ - dentry->d_inode->i_private = &thread; + d_inode(dentry)->i_private = &thread; } done_path_create(&path, dentry); return err; @@ -235,16 +235,16 @@ dentry = kern_path_locked(name, &parent); if (IS_ERR(dentry)) return PTR_ERR(dentry); - if (dentry->d_inode) { - if (dentry->d_inode->i_private == &thread) - err = vfs_rmdir(parent.dentry->d_inode, dentry); + if (d_really_is_positive(dentry)) { + if (d_inode(dentry)->i_private == &thread) + err = vfs_rmdir(d_inode(parent.dentry), dentry); else err = -EPERM; } else { err = -ENOENT; } dput(dentry); - mutex_unlock(&parent.dentry->d_inode->i_mutex); + mutex_unlock(&d_inode(parent.dentry)->i_mutex); path_put(&parent); return err; } @@ -299,18 +299,18 @@ { struct path parent; struct dentry *dentry; - int deleted = 1; + int deleted = 0; int err; dentry = kern_path_locked(nodename, &parent); if (IS_ERR(dentry)) return PTR_ERR(dentry); - if (dentry->d_inode) { + if (d_really_is_positive(dentry)) { struct kstat stat; struct path p = {.mnt = parent.mnt, .dentry = dentry}; err = vfs_getattr(&p, &stat); - if (!err && dev_mynode(dev, dentry->d_inode, &stat)) { + if (!err && dev_mynode(dev, d_inode(dentry), &stat)) { struct iattr newattrs; /* * before unlinking this node, reset permissions @@ -321,10 +321,10 @@ newattrs.ia_mode = stat.mode & ~0777; newattrs.ia_valid = ATTR_UID|ATTR_GID|ATTR_MODE; - mutex_lock(&dentry->d_inode->i_mutex); - notify_change(dentry, &newattrs); - mutex_unlock(&dentry->d_inode->i_mutex); - err = vfs_unlink(parent.dentry->d_inode, dentry); + mutex_lock(&d_inode(dentry)->i_mutex); + notify_change(dentry, &newattrs, NULL); + mutex_unlock(&d_inode(dentry)->i_mutex); + err = vfs_unlink(d_inode(parent.dentry), dentry, NULL); if (!err || err == -ENOENT) deleted = 1; } @@ -332,7 +332,7 @@ err = -ENOENT; } dput(dentry); - mutex_unlock(&parent.dentry->d_inode->i_mutex); + mutex_unlock(&d_inode(parent.dentry)->i_mutex); path_put(&parent); if (deleted && strchr(nodename, '/'))