diff options
author | David Chinner <dgc@sgi.com> | 2007-07-10 21:09:33 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-07-14 01:41:12 -0400 |
commit | b11f94d537e6b69f13770143fd7ded3d09fdbaab (patch) | |
tree | f0c485c71824285e23e7c4fe1835be6b82ba7183 | |
parent | 2a82b8be8a8dacb48cb7371449a7a9daa558b4a8 (diff) |
[XFS] Quota inode has no parent.
Avoid using a special "zero inode" as the parent of the quota inode as
this can confuse the filestreams code into thinking the quota inode has a
parent. We do not want the quota inode to follow filestreams allocation
rules, so pass a NULL as the parent inode and detect this condition when
doing stream associations.
SGI-PV: 964469
SGI-Modid: xfs-linux-melb:xfs-kern:29098a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
-rw-r--r-- | fs/xfs/quota/xfs_qm.c | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 13 |
2 files changed, 10 insertions, 6 deletions
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index eeb3d9cc0e8e..7def4c699343 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -65,7 +65,6 @@ kmem_zone_t *qm_dqtrxzone; | |||
65 | static struct shrinker *xfs_qm_shaker; | 65 | static struct shrinker *xfs_qm_shaker; |
66 | 66 | ||
67 | static cred_t xfs_zerocr; | 67 | static cred_t xfs_zerocr; |
68 | static xfs_inode_t xfs_zeroino; | ||
69 | 68 | ||
70 | STATIC void xfs_qm_list_init(xfs_dqlist_t *, char *, int); | 69 | STATIC void xfs_qm_list_init(xfs_dqlist_t *, char *, int); |
71 | STATIC void xfs_qm_list_destroy(xfs_dqlist_t *); | 70 | STATIC void xfs_qm_list_destroy(xfs_dqlist_t *); |
@@ -1415,7 +1414,7 @@ xfs_qm_qino_alloc( | |||
1415 | return error; | 1414 | return error; |
1416 | } | 1415 | } |
1417 | 1416 | ||
1418 | if ((error = xfs_dir_ialloc(&tp, &xfs_zeroino, S_IFREG, 1, 0, | 1417 | if ((error = xfs_dir_ialloc(&tp, NULL, S_IFREG, 1, 0, |
1419 | &xfs_zerocr, 0, 1, ip, &committed))) { | 1418 | &xfs_zerocr, 0, 1, ip, &committed))) { |
1420 | xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | | 1419 | xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | |
1421 | XFS_TRANS_ABORT); | 1420 | XFS_TRANS_ABORT); |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 2ef100be6c4f..59829523ab07 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -1078,6 +1078,11 @@ xfs_iread_extents( | |||
1078 | * also returns the [locked] bp pointing to the head of the freelist | 1078 | * also returns the [locked] bp pointing to the head of the freelist |
1079 | * as ialloc_context. The caller should hold this buffer across | 1079 | * as ialloc_context. The caller should hold this buffer across |
1080 | * the commit and pass it back into this routine on the second call. | 1080 | * the commit and pass it back into this routine on the second call. |
1081 | * | ||
1082 | * If we are allocating quota inodes, we do not have a parent inode | ||
1083 | * to attach to or associate with (i.e. pip == NULL) because they | ||
1084 | * are not linked into the directory structure - they are attached | ||
1085 | * directly to the superblock - and so have no parent. | ||
1081 | */ | 1086 | */ |
1082 | int | 1087 | int |
1083 | xfs_ialloc( | 1088 | xfs_ialloc( |
@@ -1103,7 +1108,7 @@ xfs_ialloc( | |||
1103 | * Call the space management code to pick | 1108 | * Call the space management code to pick |
1104 | * the on-disk inode to be allocated. | 1109 | * the on-disk inode to be allocated. |
1105 | */ | 1110 | */ |
1106 | error = xfs_dialloc(tp, pip->i_ino, mode, okalloc, | 1111 | error = xfs_dialloc(tp, pip ? pip->i_ino : 0, mode, okalloc, |
1107 | ialloc_context, call_again, &ino); | 1112 | ialloc_context, call_again, &ino); |
1108 | if (error != 0) { | 1113 | if (error != 0) { |
1109 | return error; | 1114 | return error; |
@@ -1157,7 +1162,7 @@ xfs_ialloc( | |||
1157 | if ((prid != 0) && (ip->i_d.di_version == XFS_DINODE_VERSION_1)) | 1162 | if ((prid != 0) && (ip->i_d.di_version == XFS_DINODE_VERSION_1)) |
1158 | xfs_bump_ino_vers2(tp, ip); | 1163 | xfs_bump_ino_vers2(tp, ip); |
1159 | 1164 | ||
1160 | if (XFS_INHERIT_GID(pip, vp->v_vfsp)) { | 1165 | if (pip && XFS_INHERIT_GID(pip, vp->v_vfsp)) { |
1161 | ip->i_d.di_gid = pip->i_d.di_gid; | 1166 | ip->i_d.di_gid = pip->i_d.di_gid; |
1162 | if ((pip->i_d.di_mode & S_ISGID) && (mode & S_IFMT) == S_IFDIR) { | 1167 | if ((pip->i_d.di_mode & S_ISGID) && (mode & S_IFMT) == S_IFDIR) { |
1163 | ip->i_d.di_mode |= S_ISGID; | 1168 | ip->i_d.di_mode |= S_ISGID; |
@@ -1199,7 +1204,7 @@ xfs_ialloc( | |||
1199 | flags |= XFS_ILOG_DEV; | 1204 | flags |= XFS_ILOG_DEV; |
1200 | break; | 1205 | break; |
1201 | case S_IFREG: | 1206 | case S_IFREG: |
1202 | if (xfs_inode_is_filestream(pip)) { | 1207 | if (pip && xfs_inode_is_filestream(pip)) { |
1203 | error = xfs_filestream_associate(pip, ip); | 1208 | error = xfs_filestream_associate(pip, ip); |
1204 | if (error < 0) | 1209 | if (error < 0) |
1205 | return -error; | 1210 | return -error; |
@@ -1208,7 +1213,7 @@ xfs_ialloc( | |||
1208 | } | 1213 | } |
1209 | /* fall through */ | 1214 | /* fall through */ |
1210 | case S_IFDIR: | 1215 | case S_IFDIR: |
1211 | if (pip->i_d.di_flags & XFS_DIFLAG_ANY) { | 1216 | if (pip && (pip->i_d.di_flags & XFS_DIFLAG_ANY)) { |
1212 | uint di_flags = 0; | 1217 | uint di_flags = 0; |
1213 | 1218 | ||
1214 | if ((mode & S_IFMT) == S_IFDIR) { | 1219 | if ((mode & S_IFMT) == S_IFDIR) { |