linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/6] udf: fix signedness issue
@ 2007-12-16  2:15 Marcin Slusarz
  2007-12-17 16:32 ` Jan Kara
  0 siblings, 1 reply; 4+ messages in thread
From: Marcin Slusarz @ 2007-12-16  2:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ben Fennema

sparse generated:
fs/udf/namei.c:896:15: originally declared here
fs/udf/namei.c:1147:41: warning: incorrect type in argument 3 (different signedness)
fs/udf/namei.c:1147:41:    expected int *offset
fs/udf/namei.c:1147:41:    got unsigned int *<noident>
fs/udf/namei.c:1152:78: warning: incorrect type in argument 3 (different signedness)
fs/udf/namei.c:1152:78:    expected int *offset
fs/udf/namei.c:1152:78:    got unsigned int *<noident>

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
---
 fs/udf/namei.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index bec96a6..066153f 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -1131,7 +1131,7 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
 		}
 	}
 	if (S_ISDIR(old_inode->i_mode)) {
-		uint32_t offset = udf_ext0_offset(old_inode);
+		int offset = udf_ext0_offset(old_inode);

 		if (new_inode) {
 			retval = -ENOTEMPTY;
--
1.5.3.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 5/6] udf: fix signedness issue
  2007-12-16  2:15 [PATCH 5/6] udf: fix signedness issue Marcin Slusarz
@ 2007-12-17 16:32 ` Jan Kara
  2007-12-19 19:27   ` Marcin Slusarz
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kara @ 2007-12-17 16:32 UTC (permalink / raw)
  To: Marcin Slusarz; +Cc: linux-kernel, Ben Fennema

> sparse generated:
> fs/udf/namei.c:896:15: originally declared here
> fs/udf/namei.c:1147:41: warning: incorrect type in argument 3 (different signedness)
> fs/udf/namei.c:1147:41:    expected int *offset
> fs/udf/namei.c:1147:41:    got unsigned int *<noident>
> fs/udf/namei.c:1152:78: warning: incorrect type in argument 3 (different signedness)
> fs/udf/namei.c:1152:78:    expected int *offset
> fs/udf/namei.c:1152:78:    got unsigned int *<noident>
> 
> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
  I don't think this is right. udf_get_fileident() should take "unsigned
int *" as an offset, not just "int". This means changing struct
udf_fileident_bh to use unsigned int too but that is better anyway.
  And BTW the type shouldn't be uint32_t but really unsigned int in
udf_rename (int needn't have 32 bits on all archs (although I think it
has currently)).

									Honza

> ---
>  fs/udf/namei.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/udf/namei.c b/fs/udf/namei.c
> index bec96a6..066153f 100644
> --- a/fs/udf/namei.c
> +++ b/fs/udf/namei.c
> @@ -1131,7 +1131,7 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
>  		}
>  	}
>  	if (S_ISDIR(old_inode->i_mode)) {
> -		uint32_t offset = udf_ext0_offset(old_inode);
> +		int offset = udf_ext0_offset(old_inode);
> 
>  		if (new_inode) {
>  			retval = -ENOTEMPTY;
> --
> 1.5.3.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
-- 
Jan Kara <jack@suse.cz>
SuSE CR Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 5/6] udf: fix signedness issue
  2007-12-17 16:32 ` Jan Kara
@ 2007-12-19 19:27   ` Marcin Slusarz
  2007-12-20 13:33     ` Jan Kara
  0 siblings, 1 reply; 4+ messages in thread
From: Marcin Slusarz @ 2007-12-19 19:27 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-kernel, Ben Fennema

On Mon, Dec 17, 2007 at 05:32:17PM +0100, Jan Kara wrote:
> > sparse generated:
> > fs/udf/namei.c:896:15: originally declared here
> > fs/udf/namei.c:1147:41: warning: incorrect type in argument 3 (different signedness)
> > fs/udf/namei.c:1147:41:    expected int *offset
> > fs/udf/namei.c:1147:41:    got unsigned int *<noident>
> > fs/udf/namei.c:1152:78: warning: incorrect type in argument 3 (different signedness)
> > fs/udf/namei.c:1152:78:    expected int *offset
> > fs/udf/namei.c:1152:78:    got unsigned int *<noident>
> >
> > Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
>   I don't think this is right. udf_get_fileident() should take "unsigned
> int *" as an offset, not just "int". This means changing struct
> udf_fileident_bh to use unsigned int too but that is better anyway.
>   And BTW the type shouldn't be uint32_t but really unsigned int in
> udf_rename (int needn't have 32 bits on all archs (although I think it
> has currently)).
That would be hard. Look what is happening with soffset and eoffset
eg in udf_fileident_read() - these fields are used as signed ints.

Marcin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 5/6] udf: fix signedness issue
  2007-12-19 19:27   ` Marcin Slusarz
@ 2007-12-20 13:33     ` Jan Kara
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kara @ 2007-12-20 13:33 UTC (permalink / raw)
  To: Marcin Slusarz; +Cc: linux-kernel, Ben Fennema

On Wed 19-12-07 20:27:20, Marcin Slusarz wrote:
> On Mon, Dec 17, 2007 at 05:32:17PM +0100, Jan Kara wrote:
> > > sparse generated:
> > > fs/udf/namei.c:896:15: originally declared here
> > > fs/udf/namei.c:1147:41: warning: incorrect type in argument 3 (different signedness)
> > > fs/udf/namei.c:1147:41:    expected int *offset
> > > fs/udf/namei.c:1147:41:    got unsigned int *<noident>
> > > fs/udf/namei.c:1152:78: warning: incorrect type in argument 3 (different signedness)
> > > fs/udf/namei.c:1152:78:    expected int *offset
> > > fs/udf/namei.c:1152:78:    got unsigned int *<noident>
> > >
> > > Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
> >   I don't think this is right. udf_get_fileident() should take "unsigned
> > int *" as an offset, not just "int". This means changing struct
> > udf_fileident_bh to use unsigned int too but that is better anyway.
> >   And BTW the type shouldn't be uint32_t but really unsigned int in
> > udf_rename (int needn't have 32 bits on all archs (although I think it
> > has currently)).
> That would be hard. Look what is happening with soffset and eoffset
> eg in udf_fileident_read() - these fields are used as signed ints.
  Doh, you're right. soffset can go below 0. OK, then your patch is fine.
You can add there
  Acked-by: Jan Kara <jack@suse.cz>

  BTW: If you haven't got an email from Andrew about accepting the patches
we agreed upon, then please resend the patches to him (with additional
Acked-by: Jan Kara <jack@suse.cz> and CC me) so that they don't get lost.
Thanks.

									Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-20 13:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-16  2:15 [PATCH 5/6] udf: fix signedness issue Marcin Slusarz
2007-12-17 16:32 ` Jan Kara
2007-12-19 19:27   ` Marcin Slusarz
2007-12-20 13:33     ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).