[PATCH] Creating large xattr lists may cause BUG (2 of 2)

Dave Kleikamp <[email protected]> Fri, 16 Jan 2004 08:58:16 -0600
Newsgroups gmane.comp.file-systems.jfs.patches
Message-ID <[email protected]>
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1272  -> 1.1273 
#	      fs/jfs/xattr.c	1.11    -> 1.12   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/01/15	[email protected]	1.1273
# JFS: Creating large xattr lists may cause BUG
#    
# The bug was caused by a flag being or'ed against an unitialized value, rather
# than setting the flag correctly.
# --------------------------------------------
#
diff -Nru a/fs/jfs/xattr.c b/fs/jfs/xattr.c
--- a/fs/jfs/xattr.c	Thu Jan 15 17:35:15 2004
+++ b/fs/jfs/xattr.c	Thu Jan 15 17:35:15 2004
@@ -499,7 +499,7 @@
 		if (ea_buf->xattr == NULL)
 			return -ENOMEM;
 
-		ea_buf->flag |= EA_MALLOC;
+		ea_buf->flag = EA_MALLOC;
 		ea_buf->max_size = (size + sb->s_blocksize - 1) &
 		    ~(sb->s_blocksize - 1);