aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJie Liu <jeff.liu@oracle.com>2013-11-22 01:04:00 -0500
committerBen Myers <bpm@sgi.com>2013-12-06 15:06:15 -0500
commitc61a9e39f637373929a110ad2a5922a2e8b00f4c (patch)
treed0ad6bcf0c924d523072863679e0e09cf696fe4b
parentef701600fd26cace9d513ee174688a2b83832126 (diff)
xfs: make quota metadata truncation behavior consistent to user space
In xfs_qm_scall_trunc_qfiles(), we ignore the error if failed to remove the users quota metadata and proceed to remove groups and projects if they are being there. However, in user space, the remove operation will break and return if failed to remove any kind of quota. Also for v5 super block, we can enabled both group and project quota at the same time, in this case the current error handling will cover the group error with projects but they might failed due to different reasons. It seems we'd better the error handling consistent to the user space and don't trying to remove another kind of quota metadata if the previous operation is failed. Signed-off-by: Jie Liu <jeff.liu@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ben Myers <bpm@sgi.com>
-rw-r--r--fs/xfs/xfs_qm_syscalls.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index 437c9198031a..3daf5ea1eb8d 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -278,7 +278,7 @@ xfs_qm_scall_trunc_qfiles(
278 xfs_mount_t *mp, 278 xfs_mount_t *mp,
279 uint flags) 279 uint flags)
280{ 280{
281 int error = 0, error2 = 0; 281 int error;
282 282
283 if (!xfs_sb_version_hasquota(&mp->m_sb) || flags == 0) { 283 if (!xfs_sb_version_hasquota(&mp->m_sb) || flags == 0) {
284 xfs_debug(mp, "%s: flags=%x m_qflags=%x", 284 xfs_debug(mp, "%s: flags=%x m_qflags=%x",
@@ -286,14 +286,20 @@ xfs_qm_scall_trunc_qfiles(
286 return XFS_ERROR(EINVAL); 286 return XFS_ERROR(EINVAL);
287 } 287 }
288 288
289 if (flags & XFS_DQ_USER) 289 if (flags & XFS_DQ_USER) {
290 error = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_uquotino); 290 error = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_uquotino);
291 if (flags & XFS_DQ_GROUP) 291 if (error)
292 error2 = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_gquotino); 292 return error;
293 }
294 if (flags & XFS_DQ_GROUP) {
295 error = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_gquotino);
296 if (error)
297 return error;
298 }
293 if (flags & XFS_DQ_PROJ) 299 if (flags & XFS_DQ_PROJ)
294 error2 = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_pquotino); 300 error = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_pquotino);
295 301
296 return error ? error : error2; 302 return error;
297} 303}
298 304
299/* 305/*