mirror of https://gitee.com/openkylin/linux.git
[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>
This commit is contained in:
parent
6b61b072a8
commit
01eb7c0796
|
@ -374,8 +374,8 @@ static int ea_list_i(struct gfs2_inode *ip, struct buffer_head *bh,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (er->er_data_len) {
|
if (er->er_data_len) {
|
||||||
char *prefix;
|
char *prefix = NULL;
|
||||||
unsigned int l;
|
unsigned int l = 0;
|
||||||
char c = 0;
|
char c = 0;
|
||||||
|
|
||||||
if (ei->ei_size + ea_size > er->er_data_len)
|
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.";
|
prefix = "security.";
|
||||||
l = 9;
|
l = 9;
|
||||||
break;
|
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, prefix, l);
|
||||||
memcpy(er->er_data + ei->ei_size + l, GFS2_EA2NAME(ea),
|
memcpy(er->er_data + ei->ei_size + l, GFS2_EA2NAME(ea),
|
||||||
ea->ea_name_len);
|
ea->ea_name_len);
|
||||||
|
|
Loading…
Reference in New Issue