Message ID | 20250217155043.78452-1-preichl@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | xfsprogs: Fix mismatched return type of filesize() | expand |
On Mon, Feb 17, 2025 at 04:50:43PM +0100, Pavel Reichl wrote: > The function filesize() was declared with a return type of 'long' but > defined with 'off_t'. This mismatch caused build issues due to type > incompatibility. > > This commit updates the declaration to match the definition, ensuring > consistency and preventing potential compilation errors. > > Signed-off-by: Pavel Reichl <preichl@redhat.com> Looks good, perhaps add: Fixes: 73fb78e5ee8 ("mkfs: support copying in large or sparse files") ? Otherwise, Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> > --- > mkfs/proto.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mkfs/proto.c b/mkfs/proto.c > index 6dd3a200..981f5b11 100644 > --- a/mkfs/proto.c > +++ b/mkfs/proto.c > @@ -20,7 +20,7 @@ static struct xfs_trans * getres(struct xfs_mount *mp, uint blocks); > static void rsvfile(xfs_mount_t *mp, xfs_inode_t *ip, long long len); > static int newregfile(char **pp, char **fname); > static void rtinit(xfs_mount_t *mp); > -static long filesize(int fd); > +static off_t filesize(int fd); > static int slashes_are_spaces; > > /* > -- > 2.48.1 > >
On Tue, Feb 18, 2025 at 09:18:46AM +0100, Carlos Maiolino wrote: > On Mon, Feb 17, 2025 at 04:50:43PM +0100, Pavel Reichl wrote: > > The function filesize() was declared with a return type of 'long' but > > defined with 'off_t'. This mismatch caused build issues due to type > > incompatibility. > > > > This commit updates the declaration to match the definition, ensuring > > consistency and preventing potential compilation errors. > > > > Signed-off-by: Pavel Reichl <preichl@redhat.com> > > Looks good, perhaps add: > > Fixes: 73fb78e5ee8 ("mkfs: support copying in large or sparse files") Yes please! Sorry about the discrepancy. With that fixed, Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> --D > ? > > Otherwise, > Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> > > > --- > > mkfs/proto.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/mkfs/proto.c b/mkfs/proto.c > > index 6dd3a200..981f5b11 100644 > > --- a/mkfs/proto.c > > +++ b/mkfs/proto.c > > @@ -20,7 +20,7 @@ static struct xfs_trans * getres(struct xfs_mount *mp, uint blocks); > > static void rsvfile(xfs_mount_t *mp, xfs_inode_t *ip, long long len); > > static int newregfile(char **pp, char **fname); > > static void rtinit(xfs_mount_t *mp); > > -static long filesize(int fd); > > +static off_t filesize(int fd); > > static int slashes_are_spaces; > > > > /* > > -- > > 2.48.1 > > > > >
diff --git a/mkfs/proto.c b/mkfs/proto.c index 6dd3a200..981f5b11 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -20,7 +20,7 @@ static struct xfs_trans * getres(struct xfs_mount *mp, uint blocks); static void rsvfile(xfs_mount_t *mp, xfs_inode_t *ip, long long len); static int newregfile(char **pp, char **fname); static void rtinit(xfs_mount_t *mp); -static long filesize(int fd); +static off_t filesize(int fd); static int slashes_are_spaces; /*
The function filesize() was declared with a return type of 'long' but defined with 'off_t'. This mismatch caused build issues due to type incompatibility. This commit updates the declaration to match the definition, ensuring consistency and preventing potential compilation errors. Signed-off-by: Pavel Reichl <preichl@redhat.com> --- mkfs/proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)