aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/quota/xfs_qm.c3
-rw-r--r--fs/xfs/xfs_inode.c13
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;
65static struct shrinker *xfs_qm_shaker; 65static struct shrinker *xfs_qm_shaker;
66 66
67static cred_t xfs_zerocr; 67static cred_t xfs_zerocr;
68static xfs_inode_t xfs_zeroino;
69 68
70STATIC void xfs_qm_list_init(xfs_dqlist_t *, char *, int); 69STATIC void xfs_qm_list_init(xfs_dqlist_t *, char *, int);
71STATIC void xfs_qm_list_destroy(xfs_dqlist_t *); 70STATIC 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 */
1082int 1087int
1083xfs_ialloc( 1088xfs_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) {