fs/ext3/xattr.c: ext3_xattr_unregister
PATCH 1/1 fs/ext3/xattr.c: ext3_xattr_unregister
Correction of small mistake which occurs in 2.4 and 2.6.
========
ext3/xattr.c.fixed renamed from ext3/xattr.c +1 -1
@@ -122,7 +122,7 @@ ext3_xattr_register(int name_index, stru void ext3_xattr_unregister(int name_index, struct ext3_xattr_handler *handler) { - if (name_index > 0 || name_index <= EXT3_XATTR_INDEX_MAX) { + if (name_index > 0 && name_index <= EXT3_XATTR_INDEX_MAX) { write_lock(&ext3_handler_lock); ext3_xattr_handlers[name_index-1] = NULL; write_unlock(&ext3_handler_lock);
Hi,
Quoted 1 line · GNicz
Correction of small mistake which occurs in 2.4 and 2.6.
It no longer occurs in 2.6 --- 2.6 now uses a static NULL-terminated table of handlers assembled at compile time and linked off the superblock, thus:
struct xattr_handler *ext3_xattr_handlers[] = {
&ext3_xattr_user_handler,
&ext3_xattr_trusted_handler,
#ifdef CONFIG_EXT3_FS_POSIX_ACL
&ext3_xattr_acl_access_handler,
&ext3_xattr_acl_default_handler,
#endif
#ifdef CONFIG_EXT3_FS_SECURITY
&ext3_xattr_security_handler,
#endif
NULL
};
But
ext3/xattr.c.fixed ext3_xattr_register(int name_index, stru · line 125
Quoted 2 lines
ext3/xattr.c.fixed renamed from ext3/xattr.c +1
-1- if (name_index > 0 || name_index <= EXT3_XATTR_INDEX_MAX) { + if (name_index > 0 && name_index <= EXT3_XATTR_INDEX_MAX) {
this looks good for the 2.4 version.
--Stephen