[PVFS2-CVS]
commit by robl in pvfs2-1/src/kernel/linux-2.6: acl.c inode.c
pvfs2-utils.c super.c
CVS commit program
cvs at parl.clemson.edu
Mon Nov 28 17:15:30 EST 2005
Update of /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6
In directory parlweb:/tmp/cvs-serv9002/src/kernel/linux-2.6
Modified Files:
acl.c inode.c pvfs2-utils.c super.c
Log Message:
merge 1.3.1 branch back into HEAD
Index: acl.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/acl.c,v
diff -u -w -p -u -r1.7 -r1.8
--- acl.c 26 Oct 2005 16:27:18 -0000 1.7
+++ acl.c 28 Nov 2005 22:15:30 -0000 1.8
@@ -436,7 +436,7 @@ int pvfs2_init_acl(struct inode *inode,
if (IS_ERR(acl))
return PTR_ERR(acl);
}
- if (!acl)
+ if (!acl && dir != inode)
{
inode->i_mode &= ~current->fs->umask;
}
@@ -534,7 +534,17 @@ static int pvfs2_check_acl(struct inode
int pvfs2_permission(struct inode *inode, int mask, struct nameidata *nd)
{
#ifdef HAVE_GENERIC_PERMISSION
- return generic_permission(inode, mask, pvfs2_check_acl);
+ int ret;
+
+ ret = generic_permission(inode, mask, pvfs2_check_acl);
+ pvfs2_print("pvfs2_permission: inode: %p mask = %x mode = %x current->fsuid = %x "
+ "inode->i_uid = %x, inode->i_gid = %x ret = %d\n",
+ inode, mask, inode->i_mode, current->fsuid, inode->i_uid,
+ inode->i_gid, ret);
+ pvfs2_print("pvfs2_permission: mode [%x] & mask [%x] & S_IRWXO [%x] = %d == mask [%x]?\n",
+ inode->i_mode, mask, S_IRWXO, (inode->i_mode & mask & S_IRWXO),
+ mask);
+ return ret;
#else
/* We sort of duplicate the code below from generic_permission. */
int mode = inode->i_mode;
Index: inode.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/inode.c,v
diff -u -w -p -u -r1.61 -r1.62
--- inode.c 27 Oct 2005 18:43:09 -0000 1.61
+++ inode.c 28 Nov 2005 22:15:30 -0000 1.62
@@ -430,7 +430,10 @@ struct inode *pvfs2_get_custom_inode(
return NULL;
}
+ if (inode->i_ino != PVFS2_SB(inode->i_sb)->root_handle)
+ {
inode->i_mode = mode;
+ }
inode->i_mapping->host = inode;
inode->i_uid = current->fsuid;
inode->i_gid = current->fsgid;
Index: pvfs2-utils.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/pvfs2-utils.c,v
diff -u -w -p -u -r1.110 -r1.111
--- pvfs2-utils.c 11 Nov 2005 21:31:08 -0000 1.110
+++ pvfs2-utils.c 28 Nov 2005 22:15:30 -0000 1.111
@@ -48,7 +48,7 @@ static inline int copy_attributes_to_ino
char *symname)
{
int ret = -1;
- int perm_mode = 0;
+ int perm_mode = 0, old_mode = 0;
pvfs2_inode_t *pvfs2_inode = NULL;
loff_t inode_size = 0, rounded_up_size = 0;
@@ -135,6 +135,7 @@ static inline int copy_attributes_to_ino
inode->i_mtime.tv_nsec = 0;
inode->i_ctime.tv_nsec = 0;
#endif
+ old_mode = inode->i_mode;
inode->i_mode = 0;
if (attrs->perms & PVFS_O_EXECUTE)
@@ -162,6 +163,16 @@ static inline int copy_attributes_to_ino
perm_mode |= S_ISGID;
inode->i_mode |= perm_mode;
+ /* NOTE: this will change once we move from the iget() model to the
+ * iget5() interface where i_ino will only be a hash and not the actual
+ * handle itself!
+ * Most file systems have moved to that model
+ */
+ if (inode->i_ino == PVFS2_SB(inode->i_sb)->root_handle)
+ {
+ /* special case: mark the root inode as sticky */
+ inode->i_mode |= S_ISVTX;
+ }
switch (attrs->objtype)
{
@@ -210,6 +221,8 @@ static inline int copy_attributes_to_ino
pvfs2_error("pvfs2:copy_attributes_to_inode: got invalid "
"attribute type %d\n", attrs->objtype);
}
+ pvfs2_print("pvfs2: copy_attributes_to_inode: setting inode->i_mode to %x from %x\n",
+ inode->i_mode, old_mode);
}
return ret;
}
Index: super.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/super.c,v
diff -u -w -p -u -r1.64 -r1.65
--- super.c 7 Oct 2005 21:03:08 -0000 1.64
+++ super.c 28 Nov 2005 22:15:30 -0000 1.65
@@ -345,6 +345,9 @@ static int pvfs2_statfs(
new_op->downcall.resp.statfs.blocks_total);
buf->f_type = sb->s_magic;
+ /* stash the fsid as well */
+ memcpy(&buf->f_fsid, &(PVFS2_SB(sb)->fs_id),
+ sizeof(PVFS2_SB(sb)->fs_id));
buf->f_bsize = sb->s_blocksize;
buf->f_namelen = PVFS2_NAME_LEN;
@@ -601,14 +604,16 @@ struct super_block* pvfs2_get_sb(
sb->s_blocksize_bits = PVFS2_BUFMAP_DEFAULT_DESC_SHIFT;
sb->s_maxbytes = MAX_LFS_FILESIZE;
- /* alloc and initialize our root directory inode */
+ /* alloc and initialize our root directory inode by explicitly requesting
+ * the sticky bit to be set */
root = pvfs2_get_custom_inode(
- sb, NULL, (S_IFDIR | 0755), 0, PVFS2_SB(sb)->root_handle);
+ sb, NULL, (S_IFDIR | 0755 | S_ISVTX), 0, PVFS2_SB(sb)->root_handle);
if (!root)
{
ret = -ENOMEM;
goto error_exit;
}
+ pvfs2_print("Allocated root inode [%p] with mode %x\n", root, root->i_mode);
PVFS2_I(root)->refn.fs_id = PVFS2_SB(sb)->fs_id;
/* allocates and places root dentry in dcache */
@@ -708,13 +713,15 @@ int pvfs2_fill_sb(
sb->s_blocksize_bits = PVFS2_BUFMAP_DEFAULT_DESC_SHIFT;
sb->s_maxbytes = MAX_LFS_FILESIZE;
- /* alloc and initialize our root directory inode */
- root = pvfs2_get_custom_inode(sb, NULL, (S_IFDIR | 0755),
+ /* alloc and initialize our root directory inode. be explicit about sticky
+ * bit */
+ root = pvfs2_get_custom_inode(sb, NULL, (S_IFDIR | 0755 | S_ISVTX),
0, PVFS2_SB(sb)->root_handle);
if (!root)
{
return -ENOMEM;
}
+ pvfs2_print("Allocated root inode [%p] with mode %x\n", root, root->i_mode);
PVFS2_I(root)->refn.handle = PVFS2_SB(sb)->root_handle;
PVFS2_I(root)->refn.fs_id = PVFS2_SB(sb)->fs_id;
More information about the PVFS2-CVS
mailing list