Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38887
b: refs/heads/master
c: fcb47e0
h: refs/heads/master
i:
  38885: e45c879
  38883: 20642cf
  38879: 8f62128
v: v3
  • Loading branch information
Ryan O'Hara authored and Steven Whitehouse committed Oct 3, 2006
1 parent 7f4337c commit 7948cab
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ddacfaf76dd620af9b73343a975749778321b51c
refs/heads/master: fcb47e0bd279cab5ba8299c0a1e3364d15413a6b
38 changes: 38 additions & 0 deletions trunk/fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/gfs2_ondisk.h>
#include <linux/crc32.h>
#include <linux/lm_interface.h>
#include <linux/security.h>

#include "gfs2.h"
#include "incore.h"
Expand Down Expand Up @@ -806,6 +807,39 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
return error;
}

static int gfs2_security_init(struct gfs2_inode *dip, struct gfs2_inode *ip)
{
int err;
size_t len;
void *value;
char *name;
struct gfs2_ea_request er;

err = security_inode_init_security(&ip->i_inode, &dip->i_inode,
&name, &value, &len);

if (err) {
if (err == -EOPNOTSUPP)
return 0;
return err;
}

memset(&er, 0, sizeof(struct gfs2_ea_request));

er.er_type = GFS2_EATYPE_SECURITY;
er.er_name = name;
er.er_data = value;
er.er_name_len = strlen(name);
er.er_data_len = len;

err = gfs2_ea_set_i(ip, &er);

kfree(value);
kfree(name);

return err;
}

/**
* gfs2_createi - Create a new inode
* @ghs: An array of two holders
Expand Down Expand Up @@ -897,6 +931,10 @@ struct inode *gfs2_createi(struct gfs2_holder *ghs, const struct qstr *name,
if (error)
goto fail_iput;

error = gfs2_security_init(dip, GFS2_I(inode));
if (error)
goto fail_iput;

error = link_dinode(dip, name, GFS2_I(inode));
if (error)
goto fail_iput;
Expand Down

0 comments on commit 7948cab

Please sign in to comment.