From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= Subject: Fwd: [PATCH] UFS i_blocks handling Date: Thu, 10 May 2012 00:01:22 +0200 Message-ID: <4FAAE932.70007@gmail.com> References: <4FA1620A.3040700@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig89EE933136BFD1B8198E3E36" To: linux-fsdevel@vger.kernel.org Return-path: Received: from mail-wi0-f178.google.com ([209.85.212.178]:40422 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758813Ab2EIWB3 (ORCPT ); Wed, 9 May 2012 18:01:29 -0400 Received: by wibhn19 with SMTP id hn19so799705wib.1 for ; Wed, 09 May 2012 15:01:28 -0700 (PDT) In-Reply-To: <4FA1620A.3040700@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig89EE933136BFD1B8198E3E36 Content-Type: multipart/mixed; boundary="------------070604090101070507050500" This is a multi-part message in MIME format. --------------070604090101070507050500 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Since it was ignored on LKML, I guess this should be the right list. -------- Original Message -------- Subject: [PATCH] UFS i_blocks handling Date: Wed, 02 May 2012 18:34:18 +0200 From: Vladimir '=CF=86-coder/phcoder' Serbinenko To: linux-kernel@vger.kernel.org Current UFS code doesn't maintain i_blocks. It creates 2 glitches: 1) state always says that no blocks are allocated 2) long symlinks are corrupted. For (2) in GRUB there is a workaround to check whether link is a fast link based on its length (link is considered a fast one if its size is small to fit in inline space and i_blocks =3D=3D 0) however neither Linux= nor BSD-using OS have such workaround and this should be fixed anyway. Please consider attached patch. It may be of bad quality, I haven't learned the code in question in more details. Please CC me when answering. --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------070604090101070507050500 Content-Type: text/x-diff; name="ufs.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ufs.diff" diff -ur linux-source-3.2/fs/ufs/balloc.c /home/phcoder/projects/ufs/ball= oc.c --- linux-source-3.2/fs/ufs/balloc.c 2012-04-23 00:31:32.000000000 +0200 +++ /home/phcoder/projects/ufs/balloc.c 2012-05-02 18:24:25.444822068 +02= 00 @@ -147,6 +147,8 @@ =20 UFSD("ENTER, fragment %llu, count %u\n", (unsigned long long)fragment, count); + + inode->i_blocks -=3D count; =09 if ((fragment & uspi->s_fpbmask) || (count & uspi->s_fpbmask)) { ufs_error (sb, "ufs_free_blocks", "internal error, " @@ -423,6 +425,7 @@ if (result) { ufs_cpu_to_data_ptr(sb, p, result); *err =3D 0; + inode->i_blocks +=3D count; UFS_I(inode)->i_lastfrag =3D max(UFS_I(inode)->i_lastfrag, fragment + count); ufs_clear_frags(inode, result + oldcount, --------------070604090101070507050500-- --------------enig89EE933136BFD1B8198E3E36 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk+q6TIACgkQNak7dOguQgkpOgD+MoJ/rdika0cb51o8tSQL0yMW rsnLUNIS3/k37bOO6IABAIDe1D7Nfj70FmC0RLpKdjt0vU2zFSA9LNz1LwMsnZX2 =eucr -----END PGP SIGNATURE----- --------------enig89EE933136BFD1B8198E3E36--