Commit 253112b4 authored by Chen Yang's avatar Chen Yang Committed by Anton Altaparmakov

[PATCH] Make intermezzo work again

 - Chen Yang's fix to work with NGROUPS
 - Chen Yang's fix to handle file deletion
 - Remove TCGETS handling and return  -ENOTTY for unknown ioctl code.
 - Removed InterMezzo from BROKEN state
parent 9cb5a22b
...@@ -1587,7 +1587,7 @@ config CODA_FS_OLD_API ...@@ -1587,7 +1587,7 @@ config CODA_FS_OLD_API
# #
config INTERMEZZO_FS config INTERMEZZO_FS
tristate "InterMezzo file system support (replicating fs) (EXPERIMENTAL)" tristate "InterMezzo file system support (replicating fs) (EXPERIMENTAL)"
depends on INET && EXPERIMENTAL && BROKEN depends on INET && EXPERIMENTAL
help help
InterMezzo is a networked file system with disconnected operation InterMezzo is a networked file system with disconnected operation
and kernel level write back caching. It is most often used for and kernel level write back caching. It is most often used for
......
...@@ -1300,13 +1300,9 @@ int presto_ioctl(struct inode *inode, struct file *file, ...@@ -1300,13 +1300,9 @@ int presto_ioctl(struct inode *inode, struct file *file,
return rc; return rc;
} }
case TCGETS:
EXIT;
return -EINVAL;
default: default:
EXIT; EXIT;
return -EINVAL; return -ENOTTY;
} }
EXIT; EXIT;
......
...@@ -217,9 +217,9 @@ static int presto_file_open(struct inode *inode, struct file *file) ...@@ -217,9 +217,9 @@ static int presto_file_open(struct inode *inode, struct file *file)
fdata->fd_mode = file->f_dentry->d_inode->i_mode; fdata->fd_mode = file->f_dentry->d_inode->i_mode;
fdata->fd_uid = file->f_dentry->d_inode->i_uid; fdata->fd_uid = file->f_dentry->d_inode->i_uid;
fdata->fd_gid = file->f_dentry->d_inode->i_gid; fdata->fd_gid = file->f_dentry->d_inode->i_gid;
fdata->fd_ngroups = current->ngroups; fdata->fd_ngroups = current->group_info->ngroups;
for (i=0 ; i < current->ngroups ; i++) for (i=0 ; i < current->group_info->ngroups ; i++)
fdata->fd_groups[i] = current->groups[i]; fdata->fd_groups[i] = GROUP_AT(current->group_info,i);
if (!ISLENTO(minor)) if (!ISLENTO(minor))
fdata->fd_info.flags = LENTO_FL_KML; fdata->fd_info.flags = LENTO_FL_KML;
else { else {
......
...@@ -418,7 +418,7 @@ static void izo_setup_ctxt(struct dentry *root, struct vfsmount *mnt, ...@@ -418,7 +418,7 @@ static void izo_setup_ctxt(struct dentry *root, struct vfsmount *mnt,
new.fsgid = 0; new.fsgid = 0;
new.fs = get_fs(); new.fs = get_fs();
/* XXX where can we get the groups from? */ /* XXX where can we get the groups from? */
new.ngroups = 0; new.group_info = groups_alloc(0);
push_ctxt(save, &new); push_ctxt(save, &new);
} }
......
...@@ -152,14 +152,14 @@ struct run_ctxt { ...@@ -152,14 +152,14 @@ struct run_ctxt {
uid_t fsuid; uid_t fsuid;
gid_t fsgid; gid_t fsgid;
mm_segment_t fs; mm_segment_t fs;
int ngroups; struct group_info * group_info;
gid_t groups[NGROUPS]; /* int ngroups;
gid_t groups[NGROUPS];*/
}; };
static inline void push_ctxt(struct run_ctxt *save, struct run_ctxt *new) static inline void push_ctxt(struct run_ctxt *save, struct run_ctxt *new)
{ {
int i;
save->fs = get_fs(); save->fs = get_fs();
save->pwd = dget(current->fs->pwd); save->pwd = dget(current->fs->pwd);
save->pwdmnt = mntget(current->fs->pwdmnt); save->pwdmnt = mntget(current->fs->pwdmnt);
...@@ -167,9 +167,10 @@ static inline void push_ctxt(struct run_ctxt *save, struct run_ctxt *new) ...@@ -167,9 +167,10 @@ static inline void push_ctxt(struct run_ctxt *save, struct run_ctxt *new)
save->fsuid = current->fsuid; save->fsuid = current->fsuid;
save->root = current->fs->root; save->root = current->fs->root;
save->rootmnt = current->fs->rootmnt; save->rootmnt = current->fs->rootmnt;
save->ngroups = current->ngroups; save->group_info = current->group_info;
/* save->ngroups = current->ngroups;
for (i = 0; i< current->ngroups; i++) for (i = 0; i< current->ngroups; i++)
save->groups[i] = current->groups[i]; save->groups[i] = current->groups[i];*/
set_fs(new->fs); set_fs(new->fs);
lock_kernel(); lock_kernel();
...@@ -179,18 +180,17 @@ static inline void push_ctxt(struct run_ctxt *save, struct run_ctxt *new) ...@@ -179,18 +180,17 @@ static inline void push_ctxt(struct run_ctxt *save, struct run_ctxt *new)
unlock_kernel(); unlock_kernel();
current->fsuid = new->fsuid; current->fsuid = new->fsuid;
current->fsgid = new->fsgid; current->fsgid = new->fsgid;
if (new->ngroups > 0) { /*if (new->ngroups > 0) {
current->ngroups = new->ngroups; current->ngroups = new->ngroups;
for (i = 0; i< new->ngroups; i++) for (i = 0; i< new->ngroups; i++)
current->groups[i] = new->groups[i]; current->groups[i] = new->groups[i];
} }*/
current->group_info = new->group_info;
} }
static inline void pop_ctxt(struct run_ctxt *saved) static inline void pop_ctxt(struct run_ctxt *saved)
{ {
int i;
set_fs(saved->fs); set_fs(saved->fs);
lock_kernel(); lock_kernel();
set_fs_pwd(current->fs, saved->pwdmnt, saved->pwd); set_fs_pwd(current->fs, saved->pwdmnt, saved->pwd);
...@@ -199,10 +199,12 @@ static inline void pop_ctxt(struct run_ctxt *saved) ...@@ -199,10 +199,12 @@ static inline void pop_ctxt(struct run_ctxt *saved)
unlock_kernel(); unlock_kernel();
current->fsuid = saved->fsuid; current->fsuid = saved->fsuid;
current->fsgid = saved->fsgid; current->fsgid = saved->fsgid;
current->group_info = saved->group_info;
/*
current->ngroups = saved->ngroups; current->ngroups = saved->ngroups;
for (i = 0; i< saved->ngroups; i++) for (i = 0; i< saved->ngroups; i++)
current->groups[i] = saved->groups[i]; current->groups[i] = saved->groups[i];
*/
mntput(saved->pwdmnt); mntput(saved->pwdmnt);
dput(saved->pwd); dput(saved->pwd);
} }
...@@ -392,7 +394,7 @@ struct presto_file_data { ...@@ -392,7 +394,7 @@ struct presto_file_data {
uid_t fd_fsuid; uid_t fd_fsuid;
gid_t fd_fsgid; gid_t fd_fsgid;
int fd_ngroups; int fd_ngroups;
gid_t fd_groups[NGROUPS_MAX]; gid_t fd_groups[NGROUPS_SMALL];
/* information how to complete the close operation */ /* information how to complete the close operation */
struct lento_vfs_context fd_info; struct lento_vfs_context fd_info;
struct presto_version fd_version; struct presto_version fd_version;
......
...@@ -41,7 +41,7 @@ struct big_journal_prefix { ...@@ -41,7 +41,7 @@ struct big_journal_prefix {
u32 fsgid; u32 fsgid;
u32 opcode; u32 opcode;
u32 ngroups; u32 ngroups;
u32 groups[NGROUPS_MAX]; u32 groups[NGROUPS_SMALL];
}; };
enum kml_opcode { enum kml_opcode {
......
...@@ -309,7 +309,7 @@ journal_log_prefix_with_groups_and_ids(char *buf, int opcode, ...@@ -309,7 +309,7 @@ journal_log_prefix_with_groups_and_ids(char *buf, int opcode,
__u32 fsuid, __u32 fsgid) __u32 fsuid, __u32 fsgid)
{ {
struct kml_prefix_hdr p; struct kml_prefix_hdr p;
u32 loggroups[NGROUPS_MAX]; u32 loggroups[NGROUPS_SMALL];
int i; int i;
...@@ -332,15 +332,15 @@ journal_log_prefix_with_groups_and_ids(char *buf, int opcode, ...@@ -332,15 +332,15 @@ journal_log_prefix_with_groups_and_ids(char *buf, int opcode,
static inline char * static inline char *
journal_log_prefix(char *buf, int opcode, struct rec_info *rec) journal_log_prefix(char *buf, int opcode, struct rec_info *rec)
{ {
__u32 groups[NGROUPS_MAX]; __u32 groups[NGROUPS_SMALL];
int i; int i;
/* convert 16 bit gid's to 32 bit gid's */ /* convert 16 bit gid's to 32 bit gid's */
for (i=0; i<current->ngroups; i++) for (i=0; i<current->group_info->ngroups; i++)
groups[i] = (__u32) current->groups[i]; groups[i] = GROUP_AT(current->group_info,i);
return journal_log_prefix_with_groups_and_ids(buf, opcode, rec, return journal_log_prefix_with_groups_and_ids(buf, opcode, rec,
(__u32)current->ngroups, (__u32)current->group_info->ngroups,
groups, groups,
(__u32)current->fsuid, (__u32)current->fsuid,
(__u32)current->fsgid); (__u32)current->fsgid);
...@@ -1319,7 +1319,7 @@ int presto_write_lml_close(struct rec_info *rec, ...@@ -1319,7 +1319,7 @@ int presto_write_lml_close(struct rec_info *rec,
pathlen = cpu_to_le32(MYPATHLEN(buffer, path)); pathlen = cpu_to_le32(MYPATHLEN(buffer, path));
ino = cpu_to_le64(dentry->d_inode->i_ino); ino = cpu_to_le64(dentry->d_inode->i_ino);
generation = cpu_to_le32(dentry->d_inode->i_generation); generation = cpu_to_le32(dentry->d_inode->i_generation);
size = sizeof(__u32) * current->ngroups + size = sizeof(__u32) * current->group_info->ngroups +
sizeof(struct kml_prefix_hdr) + sizeof(*new_file_ver) + sizeof(struct kml_prefix_hdr) + sizeof(*new_file_ver) +
sizeof(ino) + sizeof(generation) + sizeof(pathlen) + sizeof(ino) + sizeof(generation) + sizeof(pathlen) +
sizeof(remote_ino) + sizeof(remote_generation) + sizeof(remote_ino) + sizeof(remote_generation) +
...@@ -1529,7 +1529,7 @@ int presto_journal_setattr(struct rec_info *rec, struct presto_file_set *fset, ...@@ -1529,7 +1529,7 @@ int presto_journal_setattr(struct rec_info *rec, struct presto_file_set *fset,
BUFF_ALLOC(buffer, NULL); BUFF_ALLOC(buffer, NULL);
path = presto_path(dentry, root, buffer, PAGE_SIZE); path = presto_path(dentry, root, buffer, PAGE_SIZE);
pathlen = cpu_to_le32(MYPATHLEN(buffer, path)); pathlen = cpu_to_le32(MYPATHLEN(buffer, path));
size = sizeof(__u32) * current->ngroups + size = sizeof(__u32) * current->group_info->ngroups +
sizeof(struct kml_prefix_hdr) + sizeof(*old_ver) + sizeof(struct kml_prefix_hdr) + sizeof(*old_ver) +
sizeof(valid) + sizeof(mode) + sizeof(uid) + sizeof(gid) + sizeof(valid) + sizeof(mode) + sizeof(uid) + sizeof(gid) +
sizeof(fsize) + sizeof(mtime) + sizeof(ctime) + sizeof(flags) + sizeof(fsize) + sizeof(mtime) + sizeof(ctime) + sizeof(flags) +
...@@ -1600,7 +1600,7 @@ int presto_get_fileid(int minor, struct presto_file_set *fset, ...@@ -1600,7 +1600,7 @@ int presto_get_fileid(int minor, struct presto_file_set *fset,
BUFF_ALLOC(buffer, NULL); BUFF_ALLOC(buffer, NULL);
path = presto_path(dentry, root, buffer, PAGE_SIZE); path = presto_path(dentry, root, buffer, PAGE_SIZE);
pathlen = cpu_to_le32(MYPATHLEN(buffer, path)); pathlen = cpu_to_le32(MYPATHLEN(buffer, path));
size = sizeof(__u32) * current->ngroups + size = sizeof(__u32) * current->group_info->ngroups +
sizeof(struct kml_prefix_hdr) + sizeof(pathlen) + sizeof(struct kml_prefix_hdr) + sizeof(pathlen) +
size_round(le32_to_cpu(pathlen)) + size_round(le32_to_cpu(pathlen)) +
sizeof(struct kml_suffix); sizeof(struct kml_suffix);
...@@ -1659,7 +1659,7 @@ int presto_journal_create(struct rec_info *rec, struct presto_file_set *fset, ...@@ -1659,7 +1659,7 @@ int presto_journal_create(struct rec_info *rec, struct presto_file_set *fset,
BUFF_ALLOC(buffer, NULL); BUFF_ALLOC(buffer, NULL);
path = presto_path(dentry, root, buffer, PAGE_SIZE); path = presto_path(dentry, root, buffer, PAGE_SIZE);
pathlen = cpu_to_le32(MYPATHLEN(buffer, path)); pathlen = cpu_to_le32(MYPATHLEN(buffer, path));
size = sizeof(__u32) * current->ngroups + size = sizeof(__u32) * current->group_info->ngroups +
sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) + sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) +
sizeof(lmode) + sizeof(uid) + sizeof(gid) + sizeof(pathlen) + sizeof(lmode) + sizeof(uid) + sizeof(gid) + sizeof(pathlen) +
sizeof(struct kml_suffix); sizeof(struct kml_suffix);
...@@ -1715,7 +1715,7 @@ int presto_journal_symlink(struct rec_info *rec, struct presto_file_set *fset, ...@@ -1715,7 +1715,7 @@ int presto_journal_symlink(struct rec_info *rec, struct presto_file_set *fset,
BUFF_ALLOC(buffer, NULL); BUFF_ALLOC(buffer, NULL);
path = presto_path(dentry, root, buffer, PAGE_SIZE); path = presto_path(dentry, root, buffer, PAGE_SIZE);
pathlen = cpu_to_le32(MYPATHLEN(buffer, path)); pathlen = cpu_to_le32(MYPATHLEN(buffer, path));
size = sizeof(__u32) * current->ngroups + size = sizeof(__u32) * current->group_info->ngroups +
sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) + sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) +
sizeof(uid) + sizeof(gid) + sizeof(pathlen) + sizeof(uid) + sizeof(gid) + sizeof(pathlen) +
sizeof(targetlen) + sizeof(struct kml_suffix); sizeof(targetlen) + sizeof(struct kml_suffix);
...@@ -1773,7 +1773,7 @@ int presto_journal_mkdir(struct rec_info *rec, struct presto_file_set *fset, ...@@ -1773,7 +1773,7 @@ int presto_journal_mkdir(struct rec_info *rec, struct presto_file_set *fset,
BUFF_ALLOC(buffer, NULL); BUFF_ALLOC(buffer, NULL);
path = presto_path(dentry, root, buffer, PAGE_SIZE); path = presto_path(dentry, root, buffer, PAGE_SIZE);
pathlen = cpu_to_le32(MYPATHLEN(buffer, path)); pathlen = cpu_to_le32(MYPATHLEN(buffer, path));
size = sizeof(__u32) * current->ngroups + size = sizeof(__u32) * current->group_info->ngroups +
sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) + sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) +
sizeof(lmode) + sizeof(uid) + sizeof(gid) + sizeof(pathlen) + sizeof(lmode) + sizeof(uid) + sizeof(gid) + sizeof(pathlen) +
sizeof(struct kml_suffix); sizeof(struct kml_suffix);
...@@ -1828,7 +1828,7 @@ presto_journal_rmdir(struct rec_info *rec, struct presto_file_set *fset, ...@@ -1828,7 +1828,7 @@ presto_journal_rmdir(struct rec_info *rec, struct presto_file_set *fset,
BUFF_ALLOC(buffer, NULL); BUFF_ALLOC(buffer, NULL);
path = presto_path(dir, root, buffer, PAGE_SIZE); path = presto_path(dir, root, buffer, PAGE_SIZE);
pathlen = cpu_to_le32(MYPATHLEN(buffer, path)); pathlen = cpu_to_le32(MYPATHLEN(buffer, path));
size = sizeof(__u32) * current->ngroups + size = sizeof(__u32) * current->group_info->ngroups +
sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) + sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) +
sizeof(pathlen) + sizeof(llen) + sizeof(*rb) + sizeof(pathlen) + sizeof(llen) + sizeof(*rb) +
sizeof(struct kml_suffix); sizeof(struct kml_suffix);
...@@ -1891,7 +1891,7 @@ presto_journal_mknod(struct rec_info *rec, struct presto_file_set *fset, ...@@ -1891,7 +1891,7 @@ presto_journal_mknod(struct rec_info *rec, struct presto_file_set *fset,
BUFF_ALLOC(buffer, NULL); BUFF_ALLOC(buffer, NULL);
path = presto_path(dentry, root, buffer, PAGE_SIZE); path = presto_path(dentry, root, buffer, PAGE_SIZE);
pathlen = cpu_to_le32(MYPATHLEN(buffer, path)); pathlen = cpu_to_le32(MYPATHLEN(buffer, path));
size = sizeof(__u32) * current->ngroups + size = sizeof(__u32) * current->group_info->ngroups +
sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) + sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) +
sizeof(lmode) + sizeof(uid) + sizeof(gid) + sizeof(lmajor) + sizeof(lmode) + sizeof(uid) + sizeof(gid) + sizeof(lmajor) +
sizeof(lminor) + sizeof(pathlen) + sizeof(lminor) + sizeof(pathlen) +
...@@ -1951,7 +1951,7 @@ presto_journal_link(struct rec_info *rec, struct presto_file_set *fset, ...@@ -1951,7 +1951,7 @@ presto_journal_link(struct rec_info *rec, struct presto_file_set *fset,
BUFF_ALLOC(buffer, srcbuffer); BUFF_ALLOC(buffer, srcbuffer);
path = presto_path(tgt, root, buffer, PAGE_SIZE); path = presto_path(tgt, root, buffer, PAGE_SIZE);
pathlen = cpu_to_le32(MYPATHLEN(buffer, path)); pathlen = cpu_to_le32(MYPATHLEN(buffer, path));
size = sizeof(__u32) * current->ngroups + size = sizeof(__u32) * current->group_info->ngroups +
sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) + sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) +
sizeof(srcpathlen) + sizeof(pathlen) + sizeof(srcpathlen) + sizeof(pathlen) +
sizeof(struct kml_suffix); sizeof(struct kml_suffix);
...@@ -2009,7 +2009,7 @@ int presto_journal_rename(struct rec_info *rec, struct presto_file_set *fset, ...@@ -2009,7 +2009,7 @@ int presto_journal_rename(struct rec_info *rec, struct presto_file_set *fset,
BUFF_ALLOC(buffer, srcbuffer); BUFF_ALLOC(buffer, srcbuffer);
path = presto_path(tgt, root, buffer, PAGE_SIZE); path = presto_path(tgt, root, buffer, PAGE_SIZE);
pathlen = cpu_to_le32(MYPATHLEN(buffer, path)); pathlen = cpu_to_le32(MYPATHLEN(buffer, path));
size = sizeof(__u32) * current->ngroups + size = sizeof(__u32) * current->group_info->ngroups +
sizeof(struct kml_prefix_hdr) + 4 * sizeof(*src_dir_ver) + sizeof(struct kml_prefix_hdr) + 4 * sizeof(*src_dir_ver) +
sizeof(srcpathlen) + sizeof(pathlen) + sizeof(srcpathlen) + sizeof(pathlen) +
sizeof(struct kml_suffix); sizeof(struct kml_suffix);
...@@ -2069,7 +2069,7 @@ int presto_journal_unlink(struct rec_info *rec, struct presto_file_set *fset, ...@@ -2069,7 +2069,7 @@ int presto_journal_unlink(struct rec_info *rec, struct presto_file_set *fset,
BUFF_ALLOC(buffer, NULL); BUFF_ALLOC(buffer, NULL);
path = presto_path(dir, root, buffer, PAGE_SIZE); path = presto_path(dir, root, buffer, PAGE_SIZE);
pathlen = cpu_to_le32(MYPATHLEN(buffer, path)); pathlen = cpu_to_le32(MYPATHLEN(buffer, path));
size = sizeof(__u32) * current->ngroups + size = sizeof(__u32) * current->group_info->ngroups +
sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) + sizeof(struct kml_prefix_hdr) + 3 * sizeof(*tgt_dir_ver) +
sizeof(pathlen) + sizeof(llen) + sizeof(*rb) + sizeof(pathlen) + sizeof(llen) + sizeof(*rb) +
sizeof(old_targetlen) + sizeof(struct kml_suffix); sizeof(old_targetlen) + sizeof(struct kml_suffix);
...@@ -2116,7 +2116,7 @@ presto_journal_close(struct rec_info *rec, struct presto_file_set *fset, ...@@ -2116,7 +2116,7 @@ presto_journal_close(struct rec_info *rec, struct presto_file_set *fset,
__u32 open_fsuid; __u32 open_fsuid;
__u32 open_fsgid; __u32 open_fsgid;
__u32 open_ngroups; __u32 open_ngroups;
__u32 open_groups[NGROUPS_MAX]; __u32 open_groups[NGROUPS_SMALL];
__u32 open_mode; __u32 open_mode;
__u32 open_uid; __u32 open_uid;
__u32 open_gid; __u32 open_gid;
...@@ -2146,9 +2146,9 @@ presto_journal_close(struct rec_info *rec, struct presto_file_set *fset, ...@@ -2146,9 +2146,9 @@ presto_journal_close(struct rec_info *rec, struct presto_file_set *fset,
open_fsuid = fd->fd_fsuid; open_fsuid = fd->fd_fsuid;
open_fsgid = fd->fd_fsgid; open_fsgid = fd->fd_fsgid;
} else { } else {
open_ngroups = current->ngroups; open_ngroups = current->group_info->ngroups;
for (i=0; i<current->ngroups; i++) for (i=0; i<current->group_info->ngroups; i++)
open_groups[i] = (__u32) current->groups[i]; open_groups[i] = (__u32) GROUP_AT(current->group_info,i);
open_mode = dentry->d_inode->i_mode; open_mode = dentry->d_inode->i_mode;
open_uid = dentry->d_inode->i_uid; open_uid = dentry->d_inode->i_uid;
open_gid = dentry->d_inode->i_gid; open_gid = dentry->d_inode->i_gid;
...@@ -2246,7 +2246,7 @@ int presto_rewrite_close(struct rec_info *rec, struct presto_file_set *fset, ...@@ -2246,7 +2246,7 @@ int presto_rewrite_close(struct rec_info *rec, struct presto_file_set *fset,
/* write closes for the local close records in the LML */ /* write closes for the local close records in the LML */
int presto_complete_lml(struct presto_file_set *fset) int presto_complete_lml(struct presto_file_set *fset)
{ {
__u32 groups[NGROUPS_MAX]; __u32 groups[NGROUPS_SMALL];
loff_t lml_offset; loff_t lml_offset;
loff_t read_offset; loff_t read_offset;
char *buffer; char *buffer;
...@@ -2408,7 +2408,7 @@ int presto_journal_set_ext_attr (struct rec_info *rec, ...@@ -2408,7 +2408,7 @@ int presto_journal_set_ext_attr (struct rec_info *rec,
*/ */
mode=cpu_to_le32(dentry->d_inode->i_mode); mode=cpu_to_le32(dentry->d_inode->i_mode);
size = sizeof(__u32) * current->ngroups + size = sizeof(__u32) * current->group_info->ngroups +
sizeof(struct kml_prefix_hdr) + sizeof(struct kml_prefix_hdr) +
2 * sizeof(struct presto_version) + 2 * sizeof(struct presto_version) +
sizeof(flags) + sizeof(mode) + sizeof(namelen) + sizeof(flags) + sizeof(mode) + sizeof(namelen) +
......
...@@ -53,11 +53,11 @@ static void kmlreint_pre_secure(struct kml_rec *rec, struct file *dir, ...@@ -53,11 +53,11 @@ static void kmlreint_pre_secure(struct kml_rec *rec, struct file *dir,
ctxt.root = ctxt.pwd; ctxt.root = ctxt.pwd;
ctxt.rootmnt = ctxt.pwdmnt; ctxt.rootmnt = ctxt.pwdmnt;
if (rec->prefix.hdr->ngroups > 0) { if (rec->prefix.hdr->ngroups > 0) {
ctxt.ngroups = rec->prefix.hdr->ngroups; ctxt.group_info = groups_alloc(rec->prefix.hdr->ngroups);
for (i = 0; i< ctxt.ngroups; i++) for (i = 0; i< ctxt.group_info->ngroups; i++)
ctxt.groups[i] = rec->prefix.groups[i]; GROUP_AT(ctxt.group_info,i)= rec->prefix.groups[i];
} else } else
ctxt.ngroups = 0; ctxt.group_info = groups_alloc(0);
push_ctxt(saved, &ctxt); push_ctxt(saved, &ctxt);
} }
......
...@@ -965,8 +965,6 @@ int presto_do_unlink(struct presto_file_set *fset, struct dentry *dir, ...@@ -965,8 +965,6 @@ int presto_do_unlink(struct presto_file_set *fset, struct dentry *dir,
do_rcvd = presto_do_rcvd(info, dir); do_rcvd = presto_do_rcvd(info, dir);
error = iops->unlink(dir->d_inode, dentry); error = iops->unlink(dir->d_inode, dentry);
unlock_kernel(); unlock_kernel();
if (!error)
d_delete(dentry);
} }
if (linkno > 1) { if (linkno > 1) {
...@@ -988,10 +986,6 @@ int presto_do_unlink(struct presto_file_set *fset, struct dentry *dir, ...@@ -988,10 +986,6 @@ int presto_do_unlink(struct presto_file_set *fset, struct dentry *dir,
} }
// up(&dir->d_inode->i_zombie); // up(&dir->d_inode->i_zombie);
if (error) {
EXIT;
goto exit;
}
presto_debug_fail_blkdev(fset, KML_OPCODE_UNLINK | 0x10); presto_debug_fail_blkdev(fset, KML_OPCODE_UNLINK | 0x10);
if ( do_kml ) if ( do_kml )
...@@ -1048,6 +1042,8 @@ int lento_unlink(const char *pathname, struct lento_vfs_context *info) ...@@ -1048,6 +1042,8 @@ int lento_unlink(const char *pathname, struct lento_vfs_context *info)
if (nd.last.name[nd.last.len]) if (nd.last.name[nd.last.len])
goto slashes; goto slashes;
error = presto_do_unlink(fset, nd.dentry, dentry, info); error = presto_do_unlink(fset, nd.dentry, dentry, info);
if (!error)
d_delete(dentry);
exit2: exit2:
EXIT; EXIT;
dput(dentry); dput(dentry);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment