Skip to content

Commit 9520c19

Browse files
committed
Merge tag 'xfs-6.9-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs fix from Chandan Babu: - Allow creating new links to special files which were not associated with a project quota * tag 'xfs-6.9-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: allow cross-linking special files without project quota
2 parents 119c289 + e23d7e8 commit 9520c19

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

fs/xfs/xfs_inode.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,8 +1301,19 @@ xfs_link(
13011301
*/
13021302
if (unlikely((tdp->i_diflags & XFS_DIFLAG_PROJINHERIT) &&
13031303
tdp->i_projid != sip->i_projid)) {
1304-
error = -EXDEV;
1305-
goto error_return;
1304+
/*
1305+
* Project quota setup skips special files which can
1306+
* leave inodes in a PROJINHERIT directory without a
1307+
* project ID set. We need to allow links to be made
1308+
* to these "project-less" inodes because userspace
1309+
* expects them to succeed after project ID setup,
1310+
* but everything else should be rejected.
1311+
*/
1312+
if (!special_file(VFS_I(sip)->i_mode) ||
1313+
sip->i_projid != 0) {
1314+
error = -EXDEV;
1315+
goto error_return;
1316+
}
13061317
}
13071318

13081319
if (!resblks) {

0 commit comments

Comments
 (0)