Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Aug 2024 11:37:20 +0200 (CEST)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        =?UTF-8?Q?Stefan_E=C3=9Fer?= <se@FreeBSD.org>
Cc:        dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: git: 45d4e82bf61f - main - msdosfs: fix cluster limit when mounting FAT-16 file systems
Message-ID:  <1288204472.10012.1723282640878@localhost>
In-Reply-To: <202408091733.479HX3Wx000151@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_10011_405453788.1723282640875
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Van: "Stefan E=C3=9Fer" <se@FreeBSD.org>
Datum: 9 augustus 2024 19:33
Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commi=
ts-src-main@FreeBSD.org
Onderwerp: git: 45d4e82bf61f - main - msdosfs: fix cluster limit when  moun=
ting FAT-16 file systems

>=20
>=20
> The branch main has been updated by se:
>=20
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D45d4e82bf61f91792142a2b9e2=
af657dab8500fd
>=20
> commit 45d4e82bf61f91792142a2b9e2af657dab8500fd
> Author:     Stefan E=C3=9Fer=20
> AuthorDate: 2024-08-09 17:26:27 +0000
> Commit:     Stefan E=C3=9Fer=20
> CommitDate: 2024-08-09 17:26:27 +0000
>=20
>     msdosfs: fix cluster limit when mounting FAT-16 file systems
>    =20
>     The maximum cluster number was calculated based on the number of data
>     cluters that fit in the givem partition size and the size of the FAT
>     area. This limit did not take into account that the highest 10 cluste=
r
>     numbers are reserved and must not be used for files.
>    =20
>     PR:             280347
>     MFC after:      3 days
>     Reported by:    pho@FreeBSD.org
> ---
>  sys/fs/msdosfs/msdosfs_vfsops.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>=20
> diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfs=
ops.c
> index 258c701bd300..adcffe45df82 100644
> --- a/sys/fs/msdosfs/msdosfs_vfsops.c
> +++ b/sys/fs/msdosfs/msdosfs_vfsops.c
> @@ -722,7 +722,9 @@ mountmsdosfs(struct vnode *odevvp, struct mount *mp)
>         }
>     }
> =20
> -   clusters =3D (pmp->pm_fatsize / pmp->pm_fatmult) * pmp->pm_fatdiv ;
> +   clusters =3D (pmp->pm_fatsize / pmp->pm_fatmult) * pmp->pm_fatdiv;
> +   if (clusters >=3D (CLUST_RSRVD & pmp->pm_fatmask))
> +       clusters =3D CLUST_RSRVD & pmp->pm_fatmask;
>     if (pmp->pm_maxcluster >=3D clusters) {
>  #ifdef MSDOSFS_DEBUG
>         printf("Warning: number of clusters (%ld) exceeds FAT "
>=20
>=20
>=20
>=20
>=20


Hi,
Isn=E2=80=99t this similar? And a little bit shorter.=20
clusters =3D MIN(clusters, CLUST_RSRVD & pmp->pm_fatmask);

Regards,Ronald

------=_Part_10011_405453788.1723282640875
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><br><p><small><strong>Van:</strong> "Stefan E=C3=
=9Fer" &lt;se@FreeBSD.org&gt;<br><strong>Datum:</strong> 9 augustus 2024 19=
:33<br><strong>Aan:</strong> src-committers@FreeBSD.org, dev-commits-src-al=
l@FreeBSD.org, dev-commits-src-main@FreeBSD.org<br><strong>Onderwerp:</stro=
ng> git: 45d4e82bf61f - main - msdosfs: fix cluster limit when  mounting FA=
T-16 file systems<br></small></p><blockquote style=3D"margin-left: 5px; bor=
der-left: 3px solid #ccc; margin-right: 0px; padding-left: 5px;"><div class=
=3D"MessageRFC822Viewer" id=3D"P"><!-- P -->
<!-- processMimeMessage --><div class=3D"TextPlainViewer" id=3D"P.P"><!-- P=
.P -->The branch main has been updated by se:<br>
<br>
URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D45d4e82bf61f91792=
142a2b9e2af657dab8500fd">https://cgit.FreeBSD.org/src/commit/?id=3D45d4e82b=
f61f91792142a2b9e2af657dab8500fd</a><br>
<br>
commit 45d4e82bf61f91792142a2b9e2af657dab8500fd<br>
Author: &nbsp;&nbsp;&nbsp;&nbsp;Stefan E=C3=9Fer <se@freebsd.org><br>
AuthorDate: 2024-08-09 17:26:27 +0000<br>
Commit: &nbsp;&nbsp;&nbsp;&nbsp;Stefan E=C3=9Fer <se@freebsd.org><br>
CommitDate: 2024-08-09 17:26:27 +0000<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;msdosfs: fix cluster limit when mounting FAT-16 fil=
e systems<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;The maximum cluster number was calculated based on =
the number of data<br>
&nbsp;&nbsp;&nbsp;&nbsp;cluters that fit in the givem partition size and th=
e size of the FAT<br>
&nbsp;&nbsp;&nbsp;&nbsp;area. This limit did not take into account that the=
 highest 10 cluster<br>
&nbsp;&nbsp;&nbsp;&nbsp;numbers are reserved and must not be used for files=
.<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;PR: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;280347<br>
&nbsp;&nbsp;&nbsp;&nbsp;MFC after: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3 days<br>
&nbsp;&nbsp;&nbsp;&nbsp;Reported by: &nbsp;&nbsp;&nbsp;pho@FreeBSD.org<br>
---<br>
&nbsp;sys/fs/msdosfs/msdosfs_vfsops.c | 4 +++-<br>
&nbsp;1 file changed, 3 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsop=
s.c<br>
index 258c701bd300..adcffe45df82 100644<br>
--- a/sys/fs/msdosfs/msdosfs_vfsops.c<br>
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c<br>
@@ -722,7 +722,9 @@ mountmsdosfs(struct vnode *odevvp, struct mount *mp)<br=
>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;<br>
- &nbsp;&nbsp;clusters =3D (pmp-&gt;pm_fatsize / pmp-&gt;pm_fatmult) * pmp-=
&gt;pm_fatdiv ;<br>
+ &nbsp;&nbsp;clusters =3D (pmp-&gt;pm_fatsize / pmp-&gt;pm_fatmult) * pmp-=
&gt;pm_fatdiv;<br>
+ &nbsp;&nbsp;if (clusters &gt;=3D (CLUST_RSRVD &amp; pmp-&gt;pm_fatmask))<=
br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clusters =3D CLUST_RSRVD &amp; pmp-&g=
t;pm_fatmask;<br>
&nbsp;&nbsp;&nbsp;&nbsp;if (pmp-&gt;pm_maxcluster &gt;=3D clusters) {<br>
&nbsp;#ifdef MSDOSFS_DEBUG<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("Warning: number of =
clusters (%ld) exceeds FAT "<br>
<br>
</se@freebsd.org></se@freebsd.org></div><!-- TextPlainViewer -->
<hr>
</div><!-- MessageRFC822Viewer -->
</blockquote><br><br>Hi,<br class=3D"rw_extra"><br>Isn=E2=80=99t this simil=
ar? And a little bit shorter.&nbsp;<br class=3D"rw_extra"><br>clusters =3D =
MIN(clusters,&nbsp;<span style=3D"-webkit-tap-highlight-color: rgba(26, 26,=
 26, 0.3); -webkit-text-size-adjust: auto;">CLUST_RSRVD &amp; pmp-&gt;pm_fa=
tmask);</span><br><br>Regards,<br class=3D"rw_extra">Ronald<br class=3D"rw_=
extra"><br></body></html>
------=_Part_10011_405453788.1723282640875--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1288204472.10012.1723282640878>