this is one of the cases where we need to use d_real() - we are using more than the name of dentry here. ->d_sb is used as well, so in case of hostfs being used as a layer we get the wrong superblock.
Unified · Split
| @@ -315,7 +315,7 @@ retry: · 314 unmodified lines | ||
| 315 | 315 | if (mode & FMODE_WRITE) |
| 316 | 316 | r = w = 1; |
| 317 | 317 | |
| 318 | − name = dentry_name(file->f_path.dentry); | |
| 318 | + name = dentry_name(d_real(file->f_path.dentry, file->f_inode)); | |
| 319 | 319 | if (name == NULL) |
| 320 | 320 | return -ENOMEM; |
| 321 | 321 | |