Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751681AbdF1W0w (ORCPT ); Wed, 28 Jun 2017 18:26:52 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:33270 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751557AbdF1W0t (ORCPT ); Wed, 28 Jun 2017 18:26:49 -0400 From: Andreas Dilger Message-Id: <4D46B5E7-4001-44FE-BE94-82636D1F8512@dilger.ca> Content-Type: multipart/signed; boundary="Apple-Mail=_3DD69996-ABDB-44CA-886B-5A3126E9F6B3"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH] ext4: fix __ext4_xattr_set_credits() Date: Wed, 28 Jun 2017 16:26:39 -0600 In-Reply-To: <20170628214750.31548-1-tahsin@google.com> Cc: "Darrick J . Wong" , Jan Kara , "Theodore Ts'o" , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org To: Tahsin Erdogan References: <20170628214750.31548-1-tahsin@google.com> X-Mailer: Apple Mail (2.3273) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2185 Lines: 80 --Apple-Mail=_3DD69996-ABDB-44CA-886B-5A3126E9F6B3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Jun 28, 2017, at 3:47 PM, Tahsin Erdogan wrote: >=20 > __ext4_xattr_set_credits() calculates journal credits needed for a > set xattr operation. Currently, credits needed for quota updates are > added only if ea_inode feature is enabled which is wrong. Fix this by > moving quota related additions to above ea_inode feature check. >=20 > Fixes: 74c5bfa651af ("ext4: xattr inode deduplication") >=20 > Signed-off-by: Tahsin Erdogan Reviewed-by: Andreas Dilger > --- > fs/ext4/xattr.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c > index ce12c3fb7e59..062756b4e6d8 100644 > --- a/fs/ext4/xattr.c > +++ b/fs/ext4/xattr.c > @@ -845,6 +845,9 @@ static int __ext4_xattr_set_credits(struct = super_block *sb, > */ > credits =3D 5; >=20 > + /* Quota updates. */ > + credits +=3D EXT4_MAXQUOTAS_TRANS_BLOCKS(sb); > + > /* We are done if ea_inode feature is not enabled. */ > if (!ext4_has_feature_ea_inode(sb)) > return credits; > @@ -878,9 +881,6 @@ static int __ext4_xattr_set_credits(struct = super_block *sb, > /* Block bitmap and group descriptor updates for each block. */ > credits +=3D blocks * 2; >=20 > - /* Quota updates. */ > - credits +=3D EXT4_MAXQUOTAS_TRANS_BLOCKS(sb); > - > /* We may need to clone the existing xattr block in which case = we need > * to increment ref counts for existing ea_inodes referenced by = it. > */ > -- > 2.13.2.725.g09c95d1e9-goog >=20 Cheers, Andreas --Apple-Mail=_3DD69996-ABDB-44CA-886B-5A3126E9F6B3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iD8DBQFZVC0hpIg59Q01vtYRAsSkAJ4kdi1no8xSAGQj54o180Yfjj7mFQCcD+Do saXStyyu3hEMStvoMewoKGc= =S7Ue -----END PGP SIGNATURE----- --Apple-Mail=_3DD69996-ABDB-44CA-886B-5A3126E9F6B3--