summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/eattr.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-06-06 23:31:30 +0200
committerSteven Whitehouse <swhiteho@redhat.com>2006-06-06 23:31:30 +0200
commit01eb7c07968fdab0cca0d2474346cff176537de8 (patch)
tree6f83c514aef9ea83e313524a7c460cfddaca0397 /fs/gfs2/eattr.c
parent[GFS2] Move some fields around to reduce wasted space (diff)
downloadlinux-01eb7c07968fdab0cca0d2474346cff176537de8.tar.xz
linux-01eb7c07968fdab0cca0d2474346cff176537de8.zip
[GFS2] Fix warning on impossible event in eattr code
The caller ensures that ea_list_i() is never called with an invalid type, so lets BUG() if we see one. This clears up a couple of compiler warnings too. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/eattr.c')
-rw-r--r--fs/gfs2/eattr.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/gfs2/eattr.c b/fs/gfs2/eattr.c
index 346601538ac7..2e114c075707 100644
--- a/fs/gfs2/eattr.c
+++ b/fs/gfs2/eattr.c
@@ -374,8 +374,8 @@ static int ea_list_i(struct gfs2_inode *ip, struct buffer_head *bh,
return 0;
if (er->er_data_len) {
- char *prefix;
- unsigned int l;
+ char *prefix = NULL;
+ unsigned int l = 0;
char c = 0;
if (ei->ei_size + ea_size > er->er_data_len)
@@ -394,11 +394,10 @@ static int ea_list_i(struct gfs2_inode *ip, struct buffer_head *bh,
prefix = "security.";
l = 9;
break;
- default:
- /* FIXME: Needs looking at again */
- break;
}
+ BUG_ON(l == 0);
+
memcpy(er->er_data + ei->ei_size, prefix, l);
memcpy(er->er_data + ei->ei_size + l, GFS2_EA2NAME(ea),
ea->ea_name_len);