From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com ([209.85.128.194]:44261 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935108AbeB1V6l (ORCPT ); Wed, 28 Feb 2018 16:58:41 -0500 Received: by mail-wr0-f194.google.com with SMTP id v65so4006717wrc.11 for ; Wed, 28 Feb 2018 13:58:41 -0800 (PST) Date: Wed, 28 Feb 2018 22:58:38 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Jan Kara Cc: linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] udf: Do not mark possibly inconsistent filesystems as closed Message-ID: <20180228215838.jfxg63eze4bx5bhx@pali> References: <20180228112255.25089-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3q7ikvcjqe6amezh" Content-Disposition: inline In-Reply-To: <20180228112255.25089-1-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --3q7ikvcjqe6amezh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wednesday 28 February 2018 12:22:55 Jan Kara wrote: > If logical volume integrity descriptor contains non-closed integrity > type when mounting the volume, there are high chances that the volume is > not consistent (device was detached before the filesystem was > unmounted). Warn when mounting such volume and don't touch integrity Need to edit commit message as there is no warning in patch... > type of the volume so that fsck can recognize it and check such > filesystem. >=20 > Signed-off-by: Jan Kara > --- > fs/udf/super.c | 8 ++++++-- > fs/udf/udf_sb.h | 1 + > 2 files changed, 7 insertions(+), 2 deletions(-) >=20 > diff --git a/fs/udf/super.c b/fs/udf/super.c > index 2d4929fa884d..bf5f6084dcb2 100644 > --- a/fs/udf/super.c > +++ b/fs/udf/super.c > @@ -1988,7 +1988,10 @@ static void udf_open_lvid(struct super_block *sb) > lvidiu->impIdent.identSuffix[1] =3D UDF_OS_ID_LINUX; > ktime_get_real_ts(&ts); > udf_time_to_disk_stamp(&lvid->recordingDateAndTime, ts); > - lvid->integrityType =3D cpu_to_le32(LVID_INTEGRITY_TYPE_OPEN); > + if (le32_to_cpu(lvid->integrityType) =3D=3D LVID_INTEGRITY_TYPE_CLOSE) > + lvid->integrityType =3D cpu_to_le32(LVID_INTEGRITY_TYPE_OPEN); > + else > + UDF_SET_FLAG(sb, UDF_FLAG_INCONSISTENT); > =20 > lvid->descTag.descCRC =3D cpu_to_le16( > crc_itu_t(0, (char *)lvid + sizeof(struct tag), > @@ -2028,7 +2031,8 @@ static void udf_close_lvid(struct super_block *sb) > lvidiu->minUDFReadRev =3D cpu_to_le16(sbi->s_udfrev); > if (sbi->s_udfrev > le16_to_cpu(lvidiu->minUDFWriteRev)) > lvidiu->minUDFWriteRev =3D cpu_to_le16(sbi->s_udfrev); > - lvid->integrityType =3D cpu_to_le32(LVID_INTEGRITY_TYPE_CLOSE); > + if (!UDF_QUERY_FLAG(sb, UDF_FLAG_INCONSISTENT)) > + lvid->integrityType =3D cpu_to_le32(LVID_INTEGRITY_TYPE_CLOSE); > =20 > lvid->descTag.descCRC =3D cpu_to_le16( > crc_itu_t(0, (char *)lvid + sizeof(struct tag), > diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h > index 9dcb475fc74e..9dd3e1b9619e 100644 > --- a/fs/udf/udf_sb.h > +++ b/fs/udf/udf_sb.h > @@ -29,6 +29,7 @@ > #define UDF_FLAG_SESSION_SET 15 > #define UDF_FLAG_LASTBLOCK_SET 16 > #define UDF_FLAG_BLOCKSIZE_SET 17 > +#define UDF_FLAG_INCONSISTENT 18 > =20 > #define UDF_PART_FLAG_UNALLOC_BITMAP 0x0001 > #define UDF_PART_FLAG_UNALLOC_TABLE 0x0002 --=20 Pali Roh=C3=A1r pali.rohar@gmail.com --3q7ikvcjqe6amezh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQS4VrIQdKium2krgIWL8Mk9A+RDUgUCWpcmDAAKCRCL8Mk9A+RD UjjkAJ4mxB/T0BBqSblBT6B2geVo3QunyACgs+dsr+5VA3ruAECPIfzdjpHMgNM= =hLhi -----END PGP SIGNATURE----- --3q7ikvcjqe6amezh--