Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140095
b: refs/heads/master
c: 517b5e8
h: refs/heads/master
i:
  140093: 64fa051
  140091: 9c310c0
  140087: bea08f5
  140079: 99b7ed5
  140063: 404a253
  140031: c7c9efa
v: v3
  • Loading branch information
Christoph Hellwig authored and Christoph Hellwig committed Feb 9, 2009
1 parent 0dc58df commit 2447ac7
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 292 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a568778739030fb68805dda1af2f4ebbc3adad7d
refs/heads/master: 517b5e8c8516a25a0df3b530fd183eb493a96698
30 changes: 9 additions & 21 deletions trunk/fs/xfs/linux-2.6/xfs_iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,13 @@ xfs_vn_mknod(
* Irix uses Missed'em'V split, but doesn't want to see
* the upper 5 bits of (14bit) major.
*/
if (unlikely(!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff))
return -EINVAL;
if (S_ISCHR(mode) || S_ISBLK(mode)) {
if (unlikely(!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff))
return -EINVAL;
rdev = sysv_encode_dev(rdev);
} else {
rdev = 0;
}

if (test_default_acl && test_default_acl(dir)) {
if (!_ACL_ALLOC(default_acl)) {
Expand All @@ -224,28 +229,11 @@ xfs_vn_mknod(
}
}

xfs_dentry_to_name(&name, dentry);

if (IS_POSIXACL(dir) && !default_acl)
mode &= ~current->fs->umask;

switch (mode & S_IFMT) {
case S_IFCHR:
case S_IFBLK:
case S_IFIFO:
case S_IFSOCK:
rdev = sysv_encode_dev(rdev);
case S_IFREG:
error = xfs_create(XFS_I(dir), &name, mode, rdev, &ip, NULL);
break;
case S_IFDIR:
error = xfs_mkdir(XFS_I(dir), &name, mode, &ip, NULL);
break;
default:
error = EINVAL;
break;
}

xfs_dentry_to_name(&name, dentry);
error = xfs_create(XFS_I(dir), &name, mode, rdev, &ip, NULL);
if (unlikely(error))
goto out_free_acl;

Expand Down
Loading

0 comments on commit 2447ac7

Please sign in to comment.