* [PATCH 0/8] xfs: clean up pointer sign differences
@ 2010-01-19 0:30 Dave Chinner
2010-01-19 0:30 ` [PATCH 1/8] xfs: directory names are unsigned Dave Chinner
` (7 more replies)
0 siblings, 8 replies; 18+ messages in thread
From: Dave Chinner @ 2010-01-19 0:30 UTC (permalink / raw)
To: xfs
This patch series cleans up all the pointer sign warnings when they
are turned back on in the XFS build. These are the kernel
equivalents of the libxfs changes I posted a last week. On
Christoph's suggestion, I've made the changes for the kernel code so
that we can fix the libxfs warnings simply by resyncing the userspce
code with the kernel code.
Hence this makes all of the directory and attribute names and values
unsigned chars and uses that consistently within XFS. The on disk
formats are all unsigned, but the VFS is a mix of signed and
unsigned interfaces.
The series converts all the names and values at the highest
level to unsigned so the rest of the code doesn't need to juggle
different signedness. It cleans up all the places where we have
cast pointers, makes all functions take unsigned strings and so on.
Finally, it turns on the pointer sign warnings again (which are
actually turned off globally in the build) so that we don't
reintroduce new problems due to a lack of warnings being produced by
the compiler.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH 1/8] xfs: directory names are unsigned 2010-01-19 0:30 [PATCH 0/8] xfs: clean up pointer sign differences Dave Chinner @ 2010-01-19 0:30 ` Dave Chinner 2010-01-19 9:24 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 2/8] xfs: convert DM ops to use unsigned char names Dave Chinner ` (6 subsequent siblings) 7 siblings, 1 reply; 18+ messages in thread From: Dave Chinner @ 2010-01-19 0:30 UTC (permalink / raw) To: xfs Convert the struct xfs_name to use unsigned chars for the name strings to match both what is stored on disk (__uint8_t) and what the VFS expects (unsigned char). Signed-off-by: Dave Chinner <david@fromorbit.com> --- fs/xfs/xfs_types.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_types.h b/fs/xfs/xfs_types.h index d725428..b099045 100644 --- a/fs/xfs/xfs_types.h +++ b/fs/xfs/xfs_types.h @@ -151,8 +151,8 @@ typedef enum { } xfs_btnum_t; struct xfs_name { - const char *name; - int len; + const unsigned char *name; + int len; }; #endif /* __XFS_TYPES_H__ */ -- 1.6.5 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 1/8] xfs: directory names are unsigned 2010-01-19 0:30 ` [PATCH 1/8] xfs: directory names are unsigned Dave Chinner @ 2010-01-19 9:24 ` Christoph Hellwig 0 siblings, 0 replies; 18+ messages in thread From: Christoph Hellwig @ 2010-01-19 9:24 UTC (permalink / raw) To: Dave Chinner; +Cc: xfs On Tue, Jan 19, 2010 at 11:30:19AM +1100, Dave Chinner wrote: > Convert the struct xfs_name to use unsigned chars for the name > strings to match both what is stored on disk (__uint8_t) and what > the VFS expects (unsigned char). Looks good, Reviewed-by: Christoph Hellwig <hch@lst.de> _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 2/8] xfs: convert DM ops to use unsigned char names 2010-01-19 0:30 [PATCH 0/8] xfs: clean up pointer sign differences Dave Chinner 2010-01-19 0:30 ` [PATCH 1/8] xfs: directory names are unsigned Dave Chinner @ 2010-01-19 0:30 ` Dave Chinner 2010-01-19 9:25 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 3/8] xfs: convert dirnameops to " Dave Chinner ` (5 subsequent siblings) 7 siblings, 1 reply; 18+ messages in thread From: Dave Chinner @ 2010-01-19 0:30 UTC (permalink / raw) To: xfs dmops uses a signed char for it's namespace event. To be consistent with the rest of the code, convert them to unsigned char for the namespace string. Signed-off-by: Dave Chinner <david@fromorbit.com> --- fs/xfs/xfs_mount.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index e62fd1c..f4d1441 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -78,7 +78,8 @@ typedef int (*xfs_send_destroy_t)(struct xfs_inode *, dm_right_t); typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct xfs_mount *, struct xfs_inode *, dm_right_t, struct xfs_inode *, dm_right_t, - const char *, const char *, mode_t, int, int); + const unsigned char *, const unsigned char *, + mode_t, int, int); typedef int (*xfs_send_mount_t)(struct xfs_mount *, dm_right_t, char *, char *); typedef void (*xfs_send_unmount_t)(struct xfs_mount *, struct xfs_inode *, -- 1.6.5 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] xfs: convert DM ops to use unsigned char names 2010-01-19 0:30 ` [PATCH 2/8] xfs: convert DM ops to use unsigned char names Dave Chinner @ 2010-01-19 9:25 ` Christoph Hellwig 0 siblings, 0 replies; 18+ messages in thread From: Christoph Hellwig @ 2010-01-19 9:25 UTC (permalink / raw) To: Dave Chinner; +Cc: xfs On Tue, Jan 19, 2010 at 11:30:20AM +1100, Dave Chinner wrote: > dmops uses a signed char for it's namespace event. To be consistent > with the rest of the code, convert them to unsigned char for the > namespace string. Looks good, Reviewed-by: Christoph Hellwig <hch@lst.de> possibly we should just get rid of the dm hooks now that they've been dead for years.. _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/8] xfs: convert dirnameops to unsigned char names 2010-01-19 0:30 [PATCH 0/8] xfs: clean up pointer sign differences Dave Chinner 2010-01-19 0:30 ` [PATCH 1/8] xfs: directory names are unsigned Dave Chinner 2010-01-19 0:30 ` [PATCH 2/8] xfs: convert DM ops to use unsigned char names Dave Chinner @ 2010-01-19 0:30 ` Dave Chinner 2010-01-19 9:25 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 4/8] xfs: make xfs_dir_cilookup_result use unsigned char Dave Chinner ` (4 subsequent siblings) 7 siblings, 1 reply; 18+ messages in thread From: Dave Chinner @ 2010-01-19 0:30 UTC (permalink / raw) To: xfs To be consistent across the codebase, convert the dirnameops to pass the directory names by unsigned char strings. Signed-off-by: Dave Chinner <david@fromorbit.com> --- fs/xfs/xfs_da_btree.c | 4 ++-- fs/xfs/xfs_da_btree.h | 5 +++-- fs/xfs/xfs_dir2.c | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c index c0c8869..0ca556b 100644 --- a/fs/xfs/xfs_da_btree.c +++ b/fs/xfs/xfs_da_btree.c @@ -1534,8 +1534,8 @@ xfs_da_hashname(const __uint8_t *name, int namelen) enum xfs_dacmp xfs_da_compname( struct xfs_da_args *args, - const char *name, - int len) + const unsigned char *name, + int len) { return (args->namelen == len && memcmp(args->name, name, len) == 0) ? XFS_CMP_EXACT : XFS_CMP_DIFFERENT; diff --git a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h index 30cd08f..fe9f5a8 100644 --- a/fs/xfs/xfs_da_btree.h +++ b/fs/xfs/xfs_da_btree.h @@ -209,7 +209,8 @@ typedef struct xfs_da_state { */ struct xfs_nameops { xfs_dahash_t (*hashname)(struct xfs_name *); - enum xfs_dacmp (*compname)(struct xfs_da_args *, const char *, int); + enum xfs_dacmp (*compname)(struct xfs_da_args *, + const unsigned char *, int); }; @@ -260,7 +261,7 @@ int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno, uint xfs_da_hashname(const __uint8_t *name_string, int name_length); enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args, - const char *name, int len); + const unsigned char *name, int len); xfs_da_state_t *xfs_da_state_alloc(void); diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c index 93634a7..c21c527 100644 --- a/fs/xfs/xfs_dir2.c +++ b/fs/xfs/xfs_dir2.c @@ -66,8 +66,8 @@ xfs_ascii_ci_hashname( STATIC enum xfs_dacmp xfs_ascii_ci_compname( struct xfs_da_args *args, - const char *name, - int len) + const unsigned char *name, + int len) { enum xfs_dacmp result; int i; -- 1.6.5 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 3/8] xfs: convert dirnameops to unsigned char names 2010-01-19 0:30 ` [PATCH 3/8] xfs: convert dirnameops to " Dave Chinner @ 2010-01-19 9:25 ` Christoph Hellwig 0 siblings, 0 replies; 18+ messages in thread From: Christoph Hellwig @ 2010-01-19 9:25 UTC (permalink / raw) To: Dave Chinner; +Cc: xfs On Tue, Jan 19, 2010 at 11:30:21AM +1100, Dave Chinner wrote: > To be consistent across the codebase, convert the dirnameops to pass > the directory names by unsigned char strings. > > Signed-off-by: Dave Chinner <david@fromorbit.com> Looks good, Reviewed-by: Christoph Hellwig <hch@lst.de> _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 4/8] xfs: make xfs_dir_cilookup_result use unsigned char 2010-01-19 0:30 [PATCH 0/8] xfs: clean up pointer sign differences Dave Chinner ` (2 preceding siblings ...) 2010-01-19 0:30 ` [PATCH 3/8] xfs: convert dirnameops to " Dave Chinner @ 2010-01-19 0:30 ` Dave Chinner 2010-01-19 9:26 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 5/8] xfs: xfs_buf_iomove() doesn't care about signedness Dave Chinner ` (3 subsequent siblings) 7 siblings, 1 reply; 18+ messages in thread From: Dave Chinner @ 2010-01-19 0:30 UTC (permalink / raw) To: xfs For consistency with the result of the code. Signed-off-by: Dave Chinner <david@fromorbit.com> --- fs/xfs/xfs_dir2.c | 2 +- fs/xfs/xfs_dir2.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c index c21c527..3a8c6ba 100644 --- a/fs/xfs/xfs_dir2.c +++ b/fs/xfs/xfs_dir2.c @@ -247,7 +247,7 @@ xfs_dir_createname( int xfs_dir_cilookup_result( struct xfs_da_args *args, - const char *name, + const unsigned char *name, int len) { if (args->cmpresult == XFS_CMP_DIFFERENT) diff --git a/fs/xfs/xfs_dir2.h b/fs/xfs/xfs_dir2.h index 1d9ef96..74a3b10 100644 --- a/fs/xfs/xfs_dir2.h +++ b/fs/xfs/xfs_dir2.h @@ -100,7 +100,7 @@ extern int xfs_dir2_isleaf(struct xfs_trans *tp, struct xfs_inode *dp, extern int xfs_dir2_shrink_inode(struct xfs_da_args *args, xfs_dir2_db_t db, struct xfs_dabuf *bp); -extern int xfs_dir_cilookup_result(struct xfs_da_args *args, const char *name, - int len); +extern int xfs_dir_cilookup_result(struct xfs_da_args *args, + const unsigned char *name, int len); #endif /* __XFS_DIR2_H__ */ -- 1.6.5 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 4/8] xfs: make xfs_dir_cilookup_result use unsigned char 2010-01-19 0:30 ` [PATCH 4/8] xfs: make xfs_dir_cilookup_result use unsigned char Dave Chinner @ 2010-01-19 9:26 ` Christoph Hellwig 0 siblings, 0 replies; 18+ messages in thread From: Christoph Hellwig @ 2010-01-19 9:26 UTC (permalink / raw) To: Dave Chinner; +Cc: xfs On Tue, Jan 19, 2010 at 11:30:22AM +1100, Dave Chinner wrote: > For consistency with the result of the code. > > Signed-off-by: Dave Chinner <david@fromorbit.com> > --- > fs/xfs/xfs_dir2.c | 2 +- > fs/xfs/xfs_dir2.h | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c > index c21c527..3a8c6ba 100644 > --- a/fs/xfs/xfs_dir2.c > +++ b/fs/xfs/xfs_dir2.c > @@ -247,7 +247,7 @@ xfs_dir_createname( > int > xfs_dir_cilookup_result( > struct xfs_da_args *args, > - const char *name, > + const unsigned char *name, > int len) > { Given that the value we copy things into is unsigned anyway this looks correct, Reviewed-by: Christoph Hellwig <hch@lst.de> _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 5/8] xfs: xfs_buf_iomove() doesn't care about signedness 2010-01-19 0:30 [PATCH 0/8] xfs: clean up pointer sign differences Dave Chinner ` (3 preceding siblings ...) 2010-01-19 0:30 ` [PATCH 4/8] xfs: make xfs_dir_cilookup_result use unsigned char Dave Chinner @ 2010-01-19 0:30 ` Dave Chinner 2010-01-19 9:27 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 6/8] xfs: convert attr to use unsigned names Dave Chinner ` (2 subsequent siblings) 7 siblings, 1 reply; 18+ messages in thread From: Dave Chinner @ 2010-01-19 0:30 UTC (permalink / raw) To: xfs xfs_buf_iomove() uses xfs_caddr_t as it's parameter types, but it doesn't care about the signedness of the variables as it is just copying the data. Change the prototype to use void * so that we don't get sign warnings at call sites. Signed-off-by: Dave Chinner <david@fromorbit.com> --- fs/xfs/linux-2.6/xfs_buf.c | 2 +- fs/xfs/linux-2.6/xfs_buf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 158fad4..efd745b 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c @@ -1443,7 +1443,7 @@ xfs_buf_iomove( xfs_buf_t *bp, /* buffer to process */ size_t boff, /* starting buffer offset */ size_t bsize, /* length to copy */ - caddr_t data, /* data address */ + void *data, /* data address */ xfs_buf_rw_t mode) /* read/write/zero flag */ { size_t bend, cpoff, csize; diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h index 9a29d18..4f2ad66 100644 --- a/fs/xfs/linux-2.6/xfs_buf.h +++ b/fs/xfs/linux-2.6/xfs_buf.h @@ -243,7 +243,7 @@ extern void xfs_buf_ioend(xfs_buf_t *, int); extern void xfs_buf_ioerror(xfs_buf_t *, int); extern int xfs_buf_iorequest(xfs_buf_t *); extern int xfs_buf_iowait(xfs_buf_t *); -extern void xfs_buf_iomove(xfs_buf_t *, size_t, size_t, xfs_caddr_t, +extern void xfs_buf_iomove(xfs_buf_t *, size_t, size_t, void *, xfs_buf_rw_t); static inline int xfs_buf_iostrategy(xfs_buf_t *bp) -- 1.6.5 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 5/8] xfs: xfs_buf_iomove() doesn't care about signedness 2010-01-19 0:30 ` [PATCH 5/8] xfs: xfs_buf_iomove() doesn't care about signedness Dave Chinner @ 2010-01-19 9:27 ` Christoph Hellwig 0 siblings, 0 replies; 18+ messages in thread From: Christoph Hellwig @ 2010-01-19 9:27 UTC (permalink / raw) To: Dave Chinner; +Cc: xfs On Tue, Jan 19, 2010 at 11:30:23AM +1100, Dave Chinner wrote: > xfs_buf_iomove() uses xfs_caddr_t as it's parameter types, but it doesn't > care about the signedness of the variables as it is just copying the > data. Change the prototype to use void * so that we don't get sign > warnings at call sites. Looks good, Reviewed-by: Christoph Hellwig <hch@lst.de> _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 6/8] xfs: convert attr to use unsigned names 2010-01-19 0:30 [PATCH 0/8] xfs: clean up pointer sign differences Dave Chinner ` (4 preceding siblings ...) 2010-01-19 0:30 ` [PATCH 5/8] xfs: xfs_buf_iomove() doesn't care about signedness Dave Chinner @ 2010-01-19 0:30 ` Dave Chinner 2010-01-19 9:32 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 7/8] xfs: clean up sign warnings in dir2 code Dave Chinner 2010-01-19 0:30 ` [PATCH 8/8] xfs: make compile warn about char sign mismatches again Dave Chinner 7 siblings, 1 reply; 18+ messages in thread From: Dave Chinner @ 2010-01-19 0:30 UTC (permalink / raw) To: xfs To be consistent with the directory code, the attr code should use unsigned names. Convert the names from the vfs at the highest level to unsigned, and ænsure they are consistenly used as unsigned down to disk. Signed-off-by: Dave Chinner <david@fromorbit.com> --- fs/xfs/linux-2.6/xfs_acl.c | 11 ++++++----- fs/xfs/linux-2.6/xfs_ioctl.c | 18 +++++++++--------- fs/xfs/linux-2.6/xfs_ioctl.h | 12 ++++++------ fs/xfs/linux-2.6/xfs_ioctl32.c | 4 ++-- fs/xfs/linux-2.6/xfs_iops.c | 4 ++-- fs/xfs/linux-2.6/xfs_xattr.c | 27 +++++++++++++++++++-------- fs/xfs/xfs_acl.h | 4 ++-- fs/xfs/xfs_attr.c | 38 +++++++++++++++++++++++--------------- fs/xfs/xfs_attr.h | 2 +- fs/xfs/xfs_attr_leaf.c | 28 ++++++++++++++-------------- fs/xfs/xfs_attr_sf.h | 2 +- fs/xfs/xfs_vnodeops.h | 10 +++++----- 12 files changed, 90 insertions(+), 70 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_acl.c b/fs/xfs/linux-2.6/xfs_acl.c index 883ca5a..bf85bbe 100644 --- a/fs/xfs/linux-2.6/xfs_acl.c +++ b/fs/xfs/linux-2.6/xfs_acl.c @@ -106,7 +106,7 @@ xfs_get_acl(struct inode *inode, int type) struct posix_acl *acl; struct xfs_acl *xfs_acl; int len = sizeof(struct xfs_acl); - char *ea_name; + unsigned char *ea_name; int error; acl = get_cached_acl(inode, type); @@ -133,7 +133,8 @@ xfs_get_acl(struct inode *inode, int type) if (!xfs_acl) return ERR_PTR(-ENOMEM); - error = -xfs_attr_get(ip, ea_name, (char *)xfs_acl, &len, ATTR_ROOT); + error = -xfs_attr_get(ip, ea_name, (unsigned char *)xfs_acl, + &len, ATTR_ROOT); if (error) { /* * If the attribute doesn't exist make sure we have a negative @@ -162,7 +163,7 @@ STATIC int xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) { struct xfs_inode *ip = XFS_I(inode); - char *ea_name; + unsigned char *ea_name; int error; if (S_ISLNK(inode->i_mode)) @@ -194,7 +195,7 @@ xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) (sizeof(struct xfs_acl_entry) * (XFS_ACL_MAX_ENTRIES - acl->a_count)); - error = -xfs_attr_set(ip, ea_name, (char *)xfs_acl, + error = -xfs_attr_set(ip, ea_name, (unsigned char *)xfs_acl, len, ATTR_ROOT); kfree(xfs_acl); @@ -262,7 +263,7 @@ xfs_set_mode(struct inode *inode, mode_t mode) } static int -xfs_acl_exists(struct inode *inode, char *name) +xfs_acl_exists(struct inode *inode, unsigned char *name) { int len = sizeof(struct xfs_acl); diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index a034cf6..3906e85 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c @@ -447,12 +447,12 @@ xfs_attrlist_by_handle( int xfs_attrmulti_attr_get( struct inode *inode, - char *name, - char __user *ubuf, + unsigned char *name, + unsigned char __user *ubuf, __uint32_t *len, __uint32_t flags) { - char *kbuf; + unsigned char *kbuf; int error = EFAULT; if (*len > XATTR_SIZE_MAX) @@ -476,12 +476,12 @@ xfs_attrmulti_attr_get( int xfs_attrmulti_attr_set( struct inode *inode, - char *name, - const char __user *ubuf, + unsigned char *name, + const unsigned char __user *ubuf, __uint32_t len, __uint32_t flags) { - char *kbuf; + unsigned char *kbuf; int error = EFAULT; if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) @@ -501,7 +501,7 @@ xfs_attrmulti_attr_set( int xfs_attrmulti_attr_remove( struct inode *inode, - char *name, + unsigned char *name, __uint32_t flags) { if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) @@ -519,7 +519,7 @@ xfs_attrmulti_by_handle( xfs_fsop_attrmulti_handlereq_t am_hreq; struct dentry *dentry; unsigned int i, size; - char *attr_name; + unsigned char *attr_name; if (!capable(CAP_SYS_ADMIN)) return -XFS_ERROR(EPERM); @@ -547,7 +547,7 @@ xfs_attrmulti_by_handle( error = 0; for (i = 0; i < am_hreq.opcount; i++) { - ops[i].am_error = strncpy_from_user(attr_name, + ops[i].am_error = strncpy_from_user((char *)attr_name, ops[i].am_attrname, MAXNAMELEN); if (ops[i].am_error == 0 || ops[i].am_error == MAXNAMELEN) error = -ERANGE; diff --git a/fs/xfs/linux-2.6/xfs_ioctl.h b/fs/xfs/linux-2.6/xfs_ioctl.h index 7bd7c6a..d56173b 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.h +++ b/fs/xfs/linux-2.6/xfs_ioctl.h @@ -45,23 +45,23 @@ xfs_readlink_by_handle( extern int xfs_attrmulti_attr_get( struct inode *inode, - char *name, - char __user *ubuf, + unsigned char *name, + unsigned char __user *ubuf, __uint32_t *len, __uint32_t flags); extern int - xfs_attrmulti_attr_set( +xfs_attrmulti_attr_set( struct inode *inode, - char *name, - const char __user *ubuf, + unsigned char *name, + const unsigned char __user *ubuf, __uint32_t len, __uint32_t flags); extern int xfs_attrmulti_attr_remove( struct inode *inode, - char *name, + unsigned char *name, __uint32_t flags); extern struct dentry * diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c index be1527b..0bf6d61 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.c +++ b/fs/xfs/linux-2.6/xfs_ioctl32.c @@ -411,7 +411,7 @@ xfs_compat_attrmulti_by_handle( compat_xfs_fsop_attrmulti_handlereq_t am_hreq; struct dentry *dentry; unsigned int i, size; - char *attr_name; + unsigned char *attr_name; if (!capable(CAP_SYS_ADMIN)) return -XFS_ERROR(EPERM); @@ -440,7 +440,7 @@ xfs_compat_attrmulti_by_handle( error = 0; for (i = 0; i < am_hreq.opcount; i++) { - ops[i].am_error = strncpy_from_user(attr_name, + ops[i].am_error = strncpy_from_user((char *)attr_name, compat_ptr(ops[i].am_attrname), MAXNAMELEN); if (ops[i].am_error == 0 || ops[i].am_error == MAXNAMELEN) diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 2259460..e8566bb 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -140,10 +140,10 @@ xfs_init_security( struct xfs_inode *ip = XFS_I(inode); size_t length; void *value; - char *name; + unsigned char *name; int error; - error = security_inode_init_security(inode, dir, &name, + error = security_inode_init_security(inode, dir, (char **)&name, &value, &length); if (error) { if (error == -EOPNOTSUPP) diff --git a/fs/xfs/linux-2.6/xfs_xattr.c b/fs/xfs/linux-2.6/xfs_xattr.c index 0b18788..fa01b9d 100644 --- a/fs/xfs/linux-2.6/xfs_xattr.c +++ b/fs/xfs/linux-2.6/xfs_xattr.c @@ -45,7 +45,7 @@ xfs_xattr_get(struct dentry *dentry, const char *name, value = NULL; } - error = -xfs_attr_get(ip, name, value, &asize, xflags); + error = -xfs_attr_get(ip, (unsigned char *)name, value, &asize, xflags); if (error) return error; return asize; @@ -67,8 +67,9 @@ xfs_xattr_set(struct dentry *dentry, const char *name, const void *value, xflags |= ATTR_REPLACE; if (!value) - return -xfs_attr_remove(ip, name, xflags); - return -xfs_attr_set(ip, name, (void *)value, size, xflags); + return -xfs_attr_remove(ip, (unsigned char *)name, xflags); + return -xfs_attr_set(ip, (unsigned char *)name, + (void *)value, size, xflags); } static struct xattr_handler xfs_xattr_user_handler = { @@ -124,8 +125,13 @@ static const char *xfs_xattr_prefix(int flags) } static int -xfs_xattr_put_listent(struct xfs_attr_list_context *context, int flags, - char *name, int namelen, int valuelen, char *value) +xfs_xattr_put_listent( + struct xfs_attr_list_context *context, + int flags, + unsigned char *name, + int namelen, + int valuelen, + unsigned char *value) { unsigned int prefix_len = xfs_xattr_prefix_len(flags); char *offset; @@ -148,7 +154,7 @@ xfs_xattr_put_listent(struct xfs_attr_list_context *context, int flags, offset = (char *)context->alist + context->count; strncpy(offset, xfs_xattr_prefix(flags), prefix_len); offset += prefix_len; - strncpy(offset, name, namelen); /* real name */ + strncpy(offset, (char *)name, namelen); /* real name */ offset += namelen; *offset = '\0'; context->count += prefix_len + namelen + 1; @@ -156,8 +162,13 @@ xfs_xattr_put_listent(struct xfs_attr_list_context *context, int flags, } static int -xfs_xattr_put_listent_sizes(struct xfs_attr_list_context *context, int flags, - char *name, int namelen, int valuelen, char *value) +xfs_xattr_put_listent_sizes( + struct xfs_attr_list_context *context, + int flags, + unsigned char *name, + int namelen, + int valuelen, + unsigned char *value) { context->count += xfs_xattr_prefix_len(flags) + namelen + 1; return 0; diff --git a/fs/xfs/xfs_acl.h b/fs/xfs/xfs_acl.h index 00fd357..d13eeba 100644 --- a/fs/xfs/xfs_acl.h +++ b/fs/xfs/xfs_acl.h @@ -36,8 +36,8 @@ struct xfs_acl { }; /* On-disk XFS extended attribute names */ -#define SGI_ACL_FILE "SGI_ACL_FILE" -#define SGI_ACL_DEFAULT "SGI_ACL_DEFAULT" +#define SGI_ACL_FILE (unsigned char *)"SGI_ACL_FILE" +#define SGI_ACL_DEFAULT (unsigned char *)"SGI_ACL_DEFAULT" #define SGI_ACL_FILE_SIZE (sizeof(SGI_ACL_FILE)-1) #define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1) diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index 9d11eba..f7b426a 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c @@ -93,12 +93,12 @@ STATIC int xfs_attr_rmtval_remove(xfs_da_args_t *args); STATIC int xfs_attr_name_to_xname( struct xfs_name *xname, - const char *aname) + const unsigned char *aname) { if (!aname) return EINVAL; xname->name = aname; - xname->len = strlen(aname); + xname->len = strlen((char *)aname); if (xname->len >= MAXNAMELEN) return EFAULT; /* match IRIX behaviour */ @@ -124,7 +124,7 @@ STATIC int xfs_attr_get_int( struct xfs_inode *ip, struct xfs_name *name, - char *value, + unsigned char *value, int *valuelenp, int flags) { @@ -171,8 +171,8 @@ xfs_attr_get_int( int xfs_attr_get( xfs_inode_t *ip, - const char *name, - char *value, + const unsigned char *name, + unsigned char *value, int *valuelenp, int flags) { @@ -235,8 +235,12 @@ xfs_attr_calc_size( } STATIC int -xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, - char *value, int valuelen, int flags) +xfs_attr_set_int( + struct xfs_inode *dp, + struct xfs_name *name, + unsigned char *value, + int valuelen, + int flags) { xfs_da_args_t args; xfs_fsblock_t firstblock; @@ -452,8 +456,8 @@ out: int xfs_attr_set( xfs_inode_t *dp, - const char *name, - char *value, + const unsigned char *name, + unsigned char *value, int valuelen, int flags) { @@ -600,7 +604,7 @@ out: int xfs_attr_remove( xfs_inode_t *dp, - const char *name, + const unsigned char *name, int flags) { int error; @@ -669,9 +673,13 @@ xfs_attr_list_int(xfs_attr_list_context_t *context) */ /*ARGSUSED*/ STATIC int -xfs_attr_put_listent(xfs_attr_list_context_t *context, int flags, - char *name, int namelen, - int valuelen, char *value) +xfs_attr_put_listent( + xfs_attr_list_context_t *context, + int flags, + unsigned char *name, + int namelen, + int valuelen, + unsigned char *value) { struct attrlist *alist = (struct attrlist *)context->alist; attrlist_ent_t *aep; @@ -1980,7 +1988,7 @@ xfs_attr_rmtval_get(xfs_da_args_t *args) xfs_bmbt_irec_t map[ATTR_RMTVALUE_MAPSIZE]; xfs_mount_t *mp; xfs_daddr_t dblkno; - xfs_caddr_t dst; + void *dst; xfs_buf_t *bp; int nmap, error, tmp, valuelen, blkcnt, i; xfs_dablk_t lblkno; @@ -2039,7 +2047,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args) xfs_inode_t *dp; xfs_bmbt_irec_t map; xfs_daddr_t dblkno; - xfs_caddr_t src; + void *src; xfs_buf_t *bp; xfs_dablk_t lblkno; int blkcnt, valuelen, nmap, error, tmp, committed; diff --git a/fs/xfs/xfs_attr.h b/fs/xfs/xfs_attr.h index 9c3a243..e920d68 100644 --- a/fs/xfs/xfs_attr.h +++ b/fs/xfs/xfs_attr.h @@ -113,7 +113,7 @@ typedef struct attrlist_cursor_kern { typedef int (*put_listent_func_t)(struct xfs_attr_list_context *, int, - char *, int, int, char *); + unsigned char *, int, int, unsigned char *); typedef struct xfs_attr_list_context { struct xfs_inode *dp; /* inode */ diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index baf41b5..52519a2 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c @@ -521,11 +521,11 @@ xfs_attr_shortform_to_leaf(xfs_da_args_t *args) sfe = &sf->list[0]; for (i = 0; i < sf->hdr.count; i++) { - nargs.name = (char *)sfe->nameval; + nargs.name = sfe->nameval; nargs.namelen = sfe->namelen; - nargs.value = (char *)&sfe->nameval[nargs.namelen]; + nargs.value = &sfe->nameval[nargs.namelen]; nargs.valuelen = sfe->valuelen; - nargs.hashval = xfs_da_hashname((char *)sfe->nameval, + nargs.hashval = xfs_da_hashname(sfe->nameval, sfe->namelen); nargs.flags = XFS_ATTR_NSP_ONDISK_TO_ARGS(sfe->flags); error = xfs_attr_leaf_lookup_int(bp, &nargs); /* set a->index */ @@ -612,10 +612,10 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context) for (i = 0, sfe = &sf->list[0]; i < sf->hdr.count; i++) { error = context->put_listent(context, sfe->flags, - (char *)sfe->nameval, + sfe->nameval, (int)sfe->namelen, (int)sfe->valuelen, - (char*)&sfe->nameval[sfe->namelen]); + &sfe->nameval[sfe->namelen]); /* * Either search callback finished early or @@ -659,8 +659,8 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context) } sbp->entno = i; - sbp->hash = xfs_da_hashname((char *)sfe->nameval, sfe->namelen); - sbp->name = (char *)sfe->nameval; + sbp->hash = xfs_da_hashname(sfe->nameval, sfe->namelen); + sbp->name = sfe->nameval; sbp->namelen = sfe->namelen; /* These are bytes, and both on-disk, don't endian-flip */ sbp->valuelen = sfe->valuelen; @@ -818,9 +818,9 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff) continue; ASSERT(entry->flags & XFS_ATTR_LOCAL); name_loc = xfs_attr_leaf_name_local(leaf, i); - nargs.name = (char *)name_loc->nameval; + nargs.name = name_loc->nameval; nargs.namelen = name_loc->namelen; - nargs.value = (char *)&name_loc->nameval[nargs.namelen]; + nargs.value = &name_loc->nameval[nargs.namelen]; nargs.valuelen = be16_to_cpu(name_loc->valuelen); nargs.hashval = be32_to_cpu(entry->hashval); nargs.flags = XFS_ATTR_NSP_ONDISK_TO_ARGS(entry->flags); @@ -2370,10 +2370,10 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context) retval = context->put_listent(context, entry->flags, - (char *)name_loc->nameval, + name_loc->nameval, (int)name_loc->namelen, be16_to_cpu(name_loc->valuelen), - (char *)&name_loc->nameval[name_loc->namelen]); + &name_loc->nameval[name_loc->namelen]); if (retval) return retval; } else { @@ -2397,15 +2397,15 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context) return retval; retval = context->put_listent(context, entry->flags, - (char *)name_rmt->name, + name_rmt->name, (int)name_rmt->namelen, valuelen, - (char*)args.value); + args.value); kmem_free(args.value); } else { retval = context->put_listent(context, entry->flags, - (char *)name_rmt->name, + name_rmt->name, (int)name_rmt->namelen, valuelen, NULL); diff --git a/fs/xfs/xfs_attr_sf.h b/fs/xfs/xfs_attr_sf.h index 76ab7b0..919756e 100644 --- a/fs/xfs/xfs_attr_sf.h +++ b/fs/xfs/xfs_attr_sf.h @@ -52,7 +52,7 @@ typedef struct xfs_attr_sf_sort { __uint8_t valuelen; /* length of value */ __uint8_t flags; /* flags bits (see xfs_attr_leaf.h) */ xfs_dahash_t hash; /* this entry's hash value */ - char *name; /* name value, pointer into buffer */ + unsigned char *name; /* name value, pointer into buffer */ } xfs_attr_sf_sort_t; #define XFS_ATTR_SF_ENTSIZE_BYNAME(nlen,vlen) /* space name/value uses */ \ diff --git a/fs/xfs/xfs_vnodeops.h b/fs/xfs/xfs_vnodeops.h index 167a467..774f407 100644 --- a/fs/xfs/xfs_vnodeops.h +++ b/fs/xfs/xfs_vnodeops.h @@ -43,11 +43,11 @@ int xfs_change_file_space(struct xfs_inode *ip, int cmd, int xfs_rename(struct xfs_inode *src_dp, struct xfs_name *src_name, struct xfs_inode *src_ip, struct xfs_inode *target_dp, struct xfs_name *target_name, struct xfs_inode *target_ip); -int xfs_attr_get(struct xfs_inode *ip, const char *name, char *value, - int *valuelenp, int flags); -int xfs_attr_set(struct xfs_inode *dp, const char *name, char *value, - int valuelen, int flags); -int xfs_attr_remove(struct xfs_inode *dp, const char *name, int flags); +int xfs_attr_get(struct xfs_inode *ip, const unsigned char *name, + unsigned char *value, int *valuelenp, int flags); +int xfs_attr_set(struct xfs_inode *dp, const unsigned char *name, + unsigned char *value, int valuelen, int flags); +int xfs_attr_remove(struct xfs_inode *dp, const unsigned char *name, int flags); int xfs_attr_list(struct xfs_inode *dp, char *buffer, int bufsize, int flags, struct attrlist_cursor_kern *cursor); ssize_t xfs_read(struct xfs_inode *ip, struct kiocb *iocb, -- 1.6.5 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 6/8] xfs: convert attr to use unsigned names 2010-01-19 0:30 ` [PATCH 6/8] xfs: convert attr to use unsigned names Dave Chinner @ 2010-01-19 9:32 ` Christoph Hellwig 0 siblings, 0 replies; 18+ messages in thread From: Christoph Hellwig @ 2010-01-19 9:32 UTC (permalink / raw) To: Dave Chinner; +Cc: xfs On Tue, Jan 19, 2010 at 11:30:24AM +1100, Dave Chinner wrote: > To be consistent with the directory code, the attr code should use > unsigned names. Convert the names from the vfs at the highest level > to unsigned, and ??nsure they are consistenly used as unsigned down > to disk. > > Signed-off-by: Dave Chinner <david@fromorbit.com> > --- > fs/xfs/linux-2.6/xfs_acl.c | 11 ++++++----- > fs/xfs/linux-2.6/xfs_ioctl.c | 18 +++++++++--------- > fs/xfs/linux-2.6/xfs_ioctl.h | 12 ++++++------ > fs/xfs/linux-2.6/xfs_ioctl32.c | 4 ++-- > fs/xfs/linux-2.6/xfs_iops.c | 4 ++-- > fs/xfs/linux-2.6/xfs_xattr.c | 27 +++++++++++++++++++-------- > fs/xfs/xfs_acl.h | 4 ++-- > fs/xfs/xfs_attr.c | 38 +++++++++++++++++++++++--------------- > fs/xfs/xfs_attr.h | 2 +- > fs/xfs/xfs_attr_leaf.c | 28 ++++++++++++++-------------- > fs/xfs/xfs_attr_sf.h | 2 +- > fs/xfs/xfs_vnodeops.h | 10 +++++----- > 12 files changed, 90 insertions(+), 70 deletions(-) > > diff --git a/fs/xfs/linux-2.6/xfs_acl.c b/fs/xfs/linux-2.6/xfs_acl.c It's a bit unfortunate that the highlevel xattr code gets char froms the VFS, but better convert them at the highest level and keep the lower ones clean, so: Reviewed-by: Christoph Hellwig <hch@lst.de> _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 7/8] xfs: clean up sign warnings in dir2 code 2010-01-19 0:30 [PATCH 0/8] xfs: clean up pointer sign differences Dave Chinner ` (5 preceding siblings ...) 2010-01-19 0:30 ` [PATCH 6/8] xfs: convert attr to use unsigned names Dave Chinner @ 2010-01-19 0:30 ` Dave Chinner 2010-01-19 9:27 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 8/8] xfs: make compile warn about char sign mismatches again Dave Chinner 7 siblings, 1 reply; 18+ messages in thread From: Dave Chinner @ 2010-01-19 0:30 UTC (permalink / raw) To: xfs We are now consistently using unsigned char strings for names so fix up the remaining warnings in the dir2 code to complete the cleanup. Signed-off-by: Dave Chinner <david@fromorbit.com> --- fs/xfs/xfs_dir2.c | 2 +- fs/xfs/xfs_dir2_block.c | 9 +++++---- fs/xfs/xfs_dir2_leaf.c | 2 +- fs/xfs/xfs_dir2_sf.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c index 3a8c6ba..42520f0 100644 --- a/fs/xfs/xfs_dir2.c +++ b/fs/xfs/xfs_dir2.c @@ -44,7 +44,7 @@ #include "xfs_vnodeops.h" #include "xfs_trace.h" -struct xfs_name xfs_name_dotdot = {"..", 2}; +struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2}; /* * ASCII case-insensitive (ie. A-Z) support for directories that was diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c index ddc4ecc..779a267 100644 --- a/fs/xfs/xfs_dir2_block.c +++ b/fs/xfs/xfs_dir2_block.c @@ -57,8 +57,8 @@ static xfs_dahash_t xfs_dir_hash_dot, xfs_dir_hash_dotdot; void xfs_dir_startup(void) { - xfs_dir_hash_dot = xfs_da_hashname(".", 1); - xfs_dir_hash_dotdot = xfs_da_hashname("..", 2); + xfs_dir_hash_dot = xfs_da_hashname((unsigned char *)".", 1); + xfs_dir_hash_dotdot = xfs_da_hashname((unsigned char *)"..", 2); } /* @@ -513,8 +513,9 @@ xfs_dir2_block_getdents( /* * If it didn't fit, set the final offset to here & return. */ - if (filldir(dirent, dep->name, dep->namelen, cook & 0x7fffffff, - be64_to_cpu(dep->inumber), DT_UNKNOWN)) { + if (filldir(dirent, (char *)dep->name, dep->namelen, + cook & 0x7fffffff, be64_to_cpu(dep->inumber), + DT_UNKNOWN)) { *offset = cook & 0x7fffffff; xfs_da_brelse(NULL, bp); return 0; diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c index 29f484c..e2d8985 100644 --- a/fs/xfs/xfs_dir2_leaf.c +++ b/fs/xfs/xfs_dir2_leaf.c @@ -1081,7 +1081,7 @@ xfs_dir2_leaf_getdents( dep = (xfs_dir2_data_entry_t *)ptr; length = xfs_dir2_data_entsize(dep->namelen); - if (filldir(dirent, dep->name, dep->namelen, + if (filldir(dirent, (char *)dep->name, dep->namelen, xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff, be64_to_cpu(dep->inumber), DT_UNKNOWN)) break; diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c index 9d4f17a..c1a5945 100644 --- a/fs/xfs/xfs_dir2_sf.c +++ b/fs/xfs/xfs_dir2_sf.c @@ -782,7 +782,7 @@ xfs_dir2_sf_getdents( } ino = xfs_dir2_sf_get_inumber(sfp, xfs_dir2_sf_inumberp(sfep)); - if (filldir(dirent, sfep->name, sfep->namelen, + if (filldir(dirent, (char *)sfep->name, sfep->namelen, off & 0x7fffffff, ino, DT_UNKNOWN)) { *offset = off & 0x7fffffff; return 0; -- 1.6.5 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 7/8] xfs: clean up sign warnings in dir2 code 2010-01-19 0:30 ` [PATCH 7/8] xfs: clean up sign warnings in dir2 code Dave Chinner @ 2010-01-19 9:27 ` Christoph Hellwig 0 siblings, 0 replies; 18+ messages in thread From: Christoph Hellwig @ 2010-01-19 9:27 UTC (permalink / raw) To: Dave Chinner; +Cc: xfs On Tue, Jan 19, 2010 at 11:30:25AM +1100, Dave Chinner wrote: > We are now consistently using unsigned char strings for names > so fix up the remaining warnings in the dir2 code to complete > the cleanup. The cast in the initializers looks a bit ugly, but I don't know a better way either. Reviewed-by: Christoph Hellwig <hch@lst.de> _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 8/8] xfs: make compile warn about char sign mismatches again 2010-01-19 0:30 [PATCH 0/8] xfs: clean up pointer sign differences Dave Chinner ` (6 preceding siblings ...) 2010-01-19 0:30 ` [PATCH 7/8] xfs: clean up sign warnings in dir2 code Dave Chinner @ 2010-01-19 0:30 ` Dave Chinner 2010-01-19 9:29 ` Christoph Hellwig 7 siblings, 1 reply; 18+ messages in thread From: Dave Chinner @ 2010-01-19 0:30 UTC (permalink / raw) To: xfs The -fno-unsigned-char directive has no effect anymore as the XFs build is clean. However, the kernel build hides pointer sign differences so turn that back on so that we can clean up all the mismatches prior to a userspace code resync. Signed-off-by: Dave Chinner <david@fromorbit.com> --- fs/xfs/Makefile | 2 +- fs/xfs/xfs_vnodeops.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile index 56641fe..1926701 100644 --- a/fs/xfs/Makefile +++ b/fs/xfs/Makefile @@ -16,7 +16,7 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -EXTRA_CFLAGS += -I$(src) -I$(src)/linux-2.6 -funsigned-char +EXTRA_CFLAGS += -I$(src) -I$(src)/linux-2.6 -Wpointer-sign XFS_LINUX := linux-2.6 diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 6f26875..9f7c001 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -2199,7 +2199,8 @@ xfs_symlink( if (DM_EVENT_ENABLED(dp, DM_EVENT_SYMLINK)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_SYMLINK, dp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, - link_name->name, target_path, 0, 0, 0); + link_name->name, + (unsigned char *)target_path, 0, 0, 0); if (error) return error; } @@ -2395,7 +2396,8 @@ std_return: dp, DM_RIGHT_NULL, error ? NULL : ip, DM_RIGHT_NULL, link_name->name, - target_path, 0, error, 0); + (unsigned char *)target_path, + 0, error, 0); } if (!error) -- 1.6.5 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 8/8] xfs: make compile warn about char sign mismatches again 2010-01-19 0:30 ` [PATCH 8/8] xfs: make compile warn about char sign mismatches again Dave Chinner @ 2010-01-19 9:29 ` Christoph Hellwig 2010-01-19 11:15 ` Dave Chinner 0 siblings, 1 reply; 18+ messages in thread From: Christoph Hellwig @ 2010-01-19 9:29 UTC (permalink / raw) To: Dave Chinner; +Cc: xfs On Tue, Jan 19, 2010 at 11:30:26AM +1100, Dave Chinner wrote: > The -fno-unsigned-char directive has no effect anymore as the > XFs build is clean. However, the kernel build hides pointer sign > differences so turn that back on so that we can clean up all the > mismatches prior to a userspace code resync. Not so happy about turning the warning on so we have local compiler warning differences from the rest of the kernel again, but it's not that bad, so Reviewed-by: Christoph Hellwig <hch@lst.de> > index 6f26875..9f7c001 100644 > --- a/fs/xfs/xfs_vnodeops.c > +++ b/fs/xfs/xfs_vnodeops.c > @@ -2199,7 +2199,8 @@ xfs_symlink( > if (DM_EVENT_ENABLED(dp, DM_EVENT_SYMLINK)) { > error = XFS_SEND_NAMESP(mp, DM_EVENT_SYMLINK, dp, > DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, > - link_name->name, target_path, 0, 0, 0); > + link_name->name, > + (unsigned char *)target_path, 0, 0, 0); > if (error) > return error; > } > @@ -2395,7 +2396,8 @@ std_return: > dp, DM_RIGHT_NULL, > error ? NULL : ip, > DM_RIGHT_NULL, link_name->name, > - target_path, 0, error, 0); > + (unsigned char *)target_path, > + 0, error, 0); These changes are nowhere mentioned in the changelog. And they probably belong into the patch changing the dmapi events to take unsigned chars. _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 8/8] xfs: make compile warn about char sign mismatches again 2010-01-19 9:29 ` Christoph Hellwig @ 2010-01-19 11:15 ` Dave Chinner 0 siblings, 0 replies; 18+ messages in thread From: Dave Chinner @ 2010-01-19 11:15 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs On Tue, Jan 19, 2010 at 04:29:39AM -0500, Christoph Hellwig wrote: > On Tue, Jan 19, 2010 at 11:30:26AM +1100, Dave Chinner wrote: > > The -fno-unsigned-char directive has no effect anymore as the > > XFs build is clean. However, the kernel build hides pointer sign > > differences so turn that back on so that we can clean up all the > > mismatches prior to a userspace code resync. > > Not so happy about turning the warning on so we have local compiler > warning differences from the rest of the kernel again, but it's not > that bad, so > > > Reviewed-by: Christoph Hellwig <hch@lst.de> > > > index 6f26875..9f7c001 100644 > > --- a/fs/xfs/xfs_vnodeops.c > > +++ b/fs/xfs/xfs_vnodeops.c > > @@ -2199,7 +2199,8 @@ xfs_symlink( > > if (DM_EVENT_ENABLED(dp, DM_EVENT_SYMLINK)) { > > error = XFS_SEND_NAMESP(mp, DM_EVENT_SYMLINK, dp, > > DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, > > - link_name->name, target_path, 0, 0, 0); > > + link_name->name, > > + (unsigned char *)target_path, 0, 0, 0); > > if (error) > > return error; > > } > > @@ -2395,7 +2396,8 @@ std_return: > > dp, DM_RIGHT_NULL, > > error ? NULL : ip, > > DM_RIGHT_NULL, link_name->name, > > - target_path, 0, error, 0); > > + (unsigned char *)target_path, > > + 0, error, 0); > > These changes are nowhere mentioned in the changelog. And they probably > belong into the patch changing the dmapi events to take unsigned chars. I though I fixed that. Oh well, I'll fix it up again.... Cheers, Dave. -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2010-01-19 11:14 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-01-19 0:30 [PATCH 0/8] xfs: clean up pointer sign differences Dave Chinner 2010-01-19 0:30 ` [PATCH 1/8] xfs: directory names are unsigned Dave Chinner 2010-01-19 9:24 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 2/8] xfs: convert DM ops to use unsigned char names Dave Chinner 2010-01-19 9:25 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 3/8] xfs: convert dirnameops to " Dave Chinner 2010-01-19 9:25 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 4/8] xfs: make xfs_dir_cilookup_result use unsigned char Dave Chinner 2010-01-19 9:26 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 5/8] xfs: xfs_buf_iomove() doesn't care about signedness Dave Chinner 2010-01-19 9:27 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 6/8] xfs: convert attr to use unsigned names Dave Chinner 2010-01-19 9:32 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 7/8] xfs: clean up sign warnings in dir2 code Dave Chinner 2010-01-19 9:27 ` Christoph Hellwig 2010-01-19 0:30 ` [PATCH 8/8] xfs: make compile warn about char sign mismatches again Dave Chinner 2010-01-19 9:29 ` Christoph Hellwig 2010-01-19 11:15 ` Dave Chinner
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox