diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_ioctl.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl.c | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index 7b26cc2fd284..237f5ffb2ee8 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c | |||
@@ -23,24 +23,15 @@ | |||
23 | #include "xfs_trans.h" | 23 | #include "xfs_trans.h" |
24 | #include "xfs_sb.h" | 24 | #include "xfs_sb.h" |
25 | #include "xfs_ag.h" | 25 | #include "xfs_ag.h" |
26 | #include "xfs_dir2.h" | ||
27 | #include "xfs_alloc.h" | 26 | #include "xfs_alloc.h" |
28 | #include "xfs_dmapi.h" | ||
29 | #include "xfs_mount.h" | 27 | #include "xfs_mount.h" |
30 | #include "xfs_bmap_btree.h" | 28 | #include "xfs_bmap_btree.h" |
31 | #include "xfs_alloc_btree.h" | ||
32 | #include "xfs_ialloc_btree.h" | ||
33 | #include "xfs_attr_sf.h" | ||
34 | #include "xfs_dir2_sf.h" | ||
35 | #include "xfs_dinode.h" | 29 | #include "xfs_dinode.h" |
36 | #include "xfs_inode.h" | 30 | #include "xfs_inode.h" |
37 | #include "xfs_ioctl.h" | 31 | #include "xfs_ioctl.h" |
38 | #include "xfs_btree.h" | ||
39 | #include "xfs_ialloc.h" | ||
40 | #include "xfs_rtalloc.h" | 32 | #include "xfs_rtalloc.h" |
41 | #include "xfs_itable.h" | 33 | #include "xfs_itable.h" |
42 | #include "xfs_error.h" | 34 | #include "xfs_error.h" |
43 | #include "xfs_rw.h" | ||
44 | #include "xfs_attr.h" | 35 | #include "xfs_attr.h" |
45 | #include "xfs_bmap.h" | 36 | #include "xfs_bmap.h" |
46 | #include "xfs_buf_item.h" | 37 | #include "xfs_buf_item.h" |
@@ -527,6 +518,10 @@ xfs_attrmulti_by_handle( | |||
527 | if (copy_from_user(&am_hreq, arg, sizeof(xfs_fsop_attrmulti_handlereq_t))) | 518 | if (copy_from_user(&am_hreq, arg, sizeof(xfs_fsop_attrmulti_handlereq_t))) |
528 | return -XFS_ERROR(EFAULT); | 519 | return -XFS_ERROR(EFAULT); |
529 | 520 | ||
521 | /* overflow check */ | ||
522 | if (am_hreq.opcount >= INT_MAX / sizeof(xfs_attr_multiop_t)) | ||
523 | return -E2BIG; | ||
524 | |||
530 | dentry = xfs_handlereq_to_dentry(parfilp, &am_hreq.hreq); | 525 | dentry = xfs_handlereq_to_dentry(parfilp, &am_hreq.hreq); |
531 | if (IS_ERR(dentry)) | 526 | if (IS_ERR(dentry)) |
532 | return PTR_ERR(dentry); | 527 | return PTR_ERR(dentry); |
@@ -675,10 +670,9 @@ xfs_ioc_bulkstat( | |||
675 | error = xfs_bulkstat_single(mp, &inlast, | 670 | error = xfs_bulkstat_single(mp, &inlast, |
676 | bulkreq.ubuffer, &done); | 671 | bulkreq.ubuffer, &done); |
677 | else /* XFS_IOC_FSBULKSTAT */ | 672 | else /* XFS_IOC_FSBULKSTAT */ |
678 | error = xfs_bulkstat(mp, &inlast, &count, | 673 | error = xfs_bulkstat(mp, &inlast, &count, xfs_bulkstat_one, |
679 | (bulkstat_one_pf)xfs_bulkstat_one, NULL, | 674 | sizeof(xfs_bstat_t), bulkreq.ubuffer, |
680 | sizeof(xfs_bstat_t), bulkreq.ubuffer, | 675 | &done); |
681 | BULKSTAT_FG_QUICK, &done); | ||
682 | 676 | ||
683 | if (error) | 677 | if (error) |
684 | return -error; | 678 | return -error; |
@@ -905,7 +899,7 @@ xfs_ioctl_setattr( | |||
905 | struct xfs_dquot *olddquot = NULL; | 899 | struct xfs_dquot *olddquot = NULL; |
906 | int code; | 900 | int code; |
907 | 901 | ||
908 | xfs_itrace_entry(ip); | 902 | trace_xfs_ioctl_setattr(ip); |
909 | 903 | ||
910 | if (mp->m_flags & XFS_MOUNT_RDONLY) | 904 | if (mp->m_flags & XFS_MOUNT_RDONLY) |
911 | return XFS_ERROR(EROFS); | 905 | return XFS_ERROR(EROFS); |
@@ -1040,8 +1034,7 @@ xfs_ioctl_setattr( | |||
1040 | } | 1034 | } |
1041 | } | 1035 | } |
1042 | 1036 | ||
1043 | xfs_trans_ijoin(tp, ip, lock_flags); | 1037 | xfs_trans_ijoin(tp, ip); |
1044 | xfs_trans_ihold(tp, ip); | ||
1045 | 1038 | ||
1046 | /* | 1039 | /* |
1047 | * Change file ownership. Must be the owner or privileged. | 1040 | * Change file ownership. Must be the owner or privileged. |
@@ -1113,16 +1106,7 @@ xfs_ioctl_setattr( | |||
1113 | xfs_qm_dqrele(udqp); | 1106 | xfs_qm_dqrele(udqp); |
1114 | xfs_qm_dqrele(gdqp); | 1107 | xfs_qm_dqrele(gdqp); |
1115 | 1108 | ||
1116 | if (code) | 1109 | return code; |
1117 | return code; | ||
1118 | |||
1119 | if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE)) { | ||
1120 | XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, ip, DM_RIGHT_NULL, | ||
1121 | NULL, DM_RIGHT_NULL, NULL, NULL, 0, 0, | ||
1122 | (mask & FSX_NONBLOCK) ? DM_FLAGS_NDELAY : 0); | ||
1123 | } | ||
1124 | |||
1125 | return 0; | ||
1126 | 1110 | ||
1127 | error_return: | 1111 | error_return: |
1128 | xfs_qm_dqrele(udqp); | 1112 | xfs_qm_dqrele(udqp); |
@@ -1298,7 +1282,7 @@ xfs_file_ioctl( | |||
1298 | if (filp->f_mode & FMODE_NOCMTIME) | 1282 | if (filp->f_mode & FMODE_NOCMTIME) |
1299 | ioflags |= IO_INVIS; | 1283 | ioflags |= IO_INVIS; |
1300 | 1284 | ||
1301 | xfs_itrace_entry(ip); | 1285 | trace_xfs_file_ioctl(ip); |
1302 | 1286 | ||
1303 | switch (cmd) { | 1287 | switch (cmd) { |
1304 | case XFS_IOC_ALLOCSP: | 1288 | case XFS_IOC_ALLOCSP: |