Merge branch 'xfs-misc-fixes-for-4.2' into for-next

This commit is contained in:
Dave Chinner 2015-06-01 10:50:18 +10:00
commit e01c025fbd
5 changed files with 36 additions and 23 deletions

View file

@ -236,10 +236,10 @@ Removed Mount Options
Name Removed Name Removed
---- ------- ---- -------
delaylog/nodelaylog v3.20 delaylog/nodelaylog v4.0
ihashsize v3.20 ihashsize v4.0
irixsgid v3.20 irixsgid v4.0
osyncisdsync/osyncisosync v3.20 osyncisdsync/osyncisosync v4.0
sysctls sysctls
@ -346,5 +346,5 @@ Removed Sysctls
Name Removed Name Removed
---- ------- ---- -------
fs.xfs.xfsbufd_centisec v3.20 fs.xfs.xfsbufd_centisec v4.0
fs.xfs.age_buffer_centisecs v3.20 fs.xfs.age_buffer_centisecs v4.0

View file

@ -4424,7 +4424,15 @@ xfs_bmapi_convert_unwritten(
error = xfs_bmap_add_extent_unwritten_real(bma->tp, bma->ip, &bma->idx, error = xfs_bmap_add_extent_unwritten_real(bma->tp, bma->ip, &bma->idx,
&bma->cur, mval, bma->firstblock, bma->flist, &bma->cur, mval, bma->firstblock, bma->flist,
&tmp_logflags); &tmp_logflags);
bma->logflags |= tmp_logflags; /*
* Log the inode core unconditionally in the unwritten extent conversion
* path because the conversion might not have done so (e.g., if the
* extent count hasn't changed). We need to make sure the inode is dirty
* in the transaction for the sake of fsync(), even if nothing has
* changed, because fsync() will not force the log for this transaction
* unless it sees the inode pinned.
*/
bma->logflags |= tmp_logflags | XFS_ILOG_CORE;
if (error) if (error)
return error; return error;

View file

@ -1453,8 +1453,8 @@ struct xfs_acl {
sizeof(struct xfs_acl_entry) * XFS_ACL_MAX_ENTRIES((mp))) sizeof(struct xfs_acl_entry) * XFS_ACL_MAX_ENTRIES((mp)))
/* On-disk XFS extended attribute names */ /* On-disk XFS extended attribute names */
#define SGI_ACL_FILE (unsigned char *)"SGI_ACL_FILE" #define SGI_ACL_FILE "SGI_ACL_FILE"
#define SGI_ACL_DEFAULT (unsigned char *)"SGI_ACL_DEFAULT" #define SGI_ACL_DEFAULT "SGI_ACL_DEFAULT"
#define SGI_ACL_FILE_SIZE (sizeof(SGI_ACL_FILE)-1) #define SGI_ACL_FILE_SIZE (sizeof(SGI_ACL_FILE)-1)
#define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1) #define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1)

View file

@ -55,7 +55,6 @@ struct xfs_trans;
typedef struct xfs_dqtrx { typedef struct xfs_dqtrx {
struct xfs_dquot *qt_dquot; /* the dquot this refers to */ struct xfs_dquot *qt_dquot; /* the dquot this refers to */
ulong qt_blk_res; /* blks reserved on a dquot */ ulong qt_blk_res; /* blks reserved on a dquot */
ulong qt_blk_res_used; /* blks used from the reservation */
ulong qt_ino_res; /* inode reserved on a dquot */ ulong qt_ino_res; /* inode reserved on a dquot */
ulong qt_ino_res_used; /* inodes used from the reservation */ ulong qt_ino_res_used; /* inodes used from the reservation */
long qt_bcount_delta; /* dquot blk count changes */ long qt_bcount_delta; /* dquot blk count changes */

View file

@ -90,8 +90,9 @@ xfs_trans_dup_dqinfo(
xfs_trans_t *ntp) xfs_trans_t *ntp)
{ {
xfs_dqtrx_t *oq, *nq; xfs_dqtrx_t *oq, *nq;
int i,j; int i, j;
xfs_dqtrx_t *oqa, *nqa; xfs_dqtrx_t *oqa, *nqa;
ulong blk_res_used;
if (!otp->t_dqinfo) if (!otp->t_dqinfo)
return; return;
@ -102,18 +103,23 @@ xfs_trans_dup_dqinfo(
* Because the quota blk reservation is carried forward, * Because the quota blk reservation is carried forward,
* it is also necessary to carry forward the DQ_DIRTY flag. * it is also necessary to carry forward the DQ_DIRTY flag.
*/ */
if(otp->t_flags & XFS_TRANS_DQ_DIRTY) if (otp->t_flags & XFS_TRANS_DQ_DIRTY)
ntp->t_flags |= XFS_TRANS_DQ_DIRTY; ntp->t_flags |= XFS_TRANS_DQ_DIRTY;
for (j = 0; j < XFS_QM_TRANS_DQTYPES; j++) { for (j = 0; j < XFS_QM_TRANS_DQTYPES; j++) {
oqa = otp->t_dqinfo->dqs[j]; oqa = otp->t_dqinfo->dqs[j];
nqa = ntp->t_dqinfo->dqs[j]; nqa = ntp->t_dqinfo->dqs[j];
for (i = 0; i < XFS_QM_TRANS_MAXDQS; i++) { for (i = 0; i < XFS_QM_TRANS_MAXDQS; i++) {
blk_res_used = 0;
if (oqa[i].qt_dquot == NULL) if (oqa[i].qt_dquot == NULL)
break; break;
oq = &oqa[i]; oq = &oqa[i];
nq = &nqa[i]; nq = &nqa[i];
if (oq->qt_blk_res && oq->qt_bcount_delta > 0)
blk_res_used = oq->qt_bcount_delta;
nq->qt_dquot = oq->qt_dquot; nq->qt_dquot = oq->qt_dquot;
nq->qt_bcount_delta = nq->qt_icount_delta = 0; nq->qt_bcount_delta = nq->qt_icount_delta = 0;
nq->qt_rtbcount_delta = 0; nq->qt_rtbcount_delta = 0;
@ -121,8 +127,8 @@ xfs_trans_dup_dqinfo(
/* /*
* Transfer whatever is left of the reservations. * Transfer whatever is left of the reservations.
*/ */
nq->qt_blk_res = oq->qt_blk_res - oq->qt_blk_res_used; nq->qt_blk_res = oq->qt_blk_res - blk_res_used;
oq->qt_blk_res = oq->qt_blk_res_used; oq->qt_blk_res = blk_res_used;
nq->qt_rtblk_res = oq->qt_rtblk_res - nq->qt_rtblk_res = oq->qt_rtblk_res -
oq->qt_rtblk_res_used; oq->qt_rtblk_res_used;
@ -239,10 +245,6 @@ xfs_trans_mod_dquot(
* disk blocks used. * disk blocks used.
*/ */
case XFS_TRANS_DQ_BCOUNT: case XFS_TRANS_DQ_BCOUNT:
if (qtrx->qt_blk_res && delta > 0) {
qtrx->qt_blk_res_used += (ulong)delta;
ASSERT(qtrx->qt_blk_res >= qtrx->qt_blk_res_used);
}
qtrx->qt_bcount_delta += delta; qtrx->qt_bcount_delta += delta;
break; break;
@ -423,15 +425,19 @@ xfs_trans_apply_dquot_deltas(
* reservation that a transaction structure knows of. * reservation that a transaction structure knows of.
*/ */
if (qtrx->qt_blk_res != 0) { if (qtrx->qt_blk_res != 0) {
if (qtrx->qt_blk_res != qtrx->qt_blk_res_used) { ulong blk_res_used = 0;
if (qtrx->qt_blk_res >
qtrx->qt_blk_res_used) if (qtrx->qt_bcount_delta > 0)
blk_res_used = qtrx->qt_bcount_delta;
if (qtrx->qt_blk_res != blk_res_used) {
if (qtrx->qt_blk_res > blk_res_used)
dqp->q_res_bcount -= (xfs_qcnt_t) dqp->q_res_bcount -= (xfs_qcnt_t)
(qtrx->qt_blk_res - (qtrx->qt_blk_res -
qtrx->qt_blk_res_used); blk_res_used);
else else
dqp->q_res_bcount -= (xfs_qcnt_t) dqp->q_res_bcount -= (xfs_qcnt_t)
(qtrx->qt_blk_res_used - (blk_res_used -
qtrx->qt_blk_res); qtrx->qt_blk_res);
} }
} else { } else {