From c088cf871cd83517fbe161a2049e601e46528b90 Mon Sep 17 00:00:00 2001 From: youfeng Date: Tue, 30 Sep 2003 06:08:07 +0000 Subject: [PATCH] b 1585 Support immutable attributes to prevent accidental file deletion from the archives --- lustre/llite/llite_internal.h | 4 +++- lustre/mds/mds_lib.c | 5 +++-- lustre/obdclass/obdo.c | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 34f9a4d..35d69be 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -152,9 +152,11 @@ void ll_update_inode(struct inode *inode, struct mds_body *body, int it_disposition(struct lookup_intent *it, int flag); void it_set_disposition(struct lookup_intent *it, int flag); void ll_read_inode2(struct inode *inode, void *opaque); +int ll_iocontrol(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); void ll_umount_begin(struct super_block *sb); int ll_prep_inode(struct obd_export *exp, struct inode **inode, - struct ptlrpc_request *req, int offset, struct super_block *sb); + struct ptlrpc_request *req, int offset, struct super_block *sb); /* llite/symlink.c */ extern struct inode_operations ll_fast_symlink_inode_operations; diff --git a/lustre/mds/mds_lib.c b/lustre/mds/mds_lib.c index a9b6f3f..c5d4839 100644 --- a/lustre/mds/mds_lib.c +++ b/lustre/mds/mds_lib.c @@ -59,8 +59,9 @@ void mds_pack_inode2fid(struct ll_fid *fid, struct inode *inode) /* Note that we can copy all of the fields, just some will not be "valid" */ void mds_pack_inode2body(struct mds_body *b, struct inode *inode) { - b->valid |= OBD_MD_FLID | OBD_MD_FLCTIME | OBD_MD_FLUID | OBD_MD_FLGID | - OBD_MD_FLTYPE | OBD_MD_FLMODE | OBD_MD_FLNLINK | OBD_MD_FLGENER; + b->valid |= OBD_MD_FLID | OBD_MD_FLCTIME | OBD_MD_FLUID | + OBD_MD_FLGID | OBD_MD_FLFLAGS | OBD_MD_FLTYPE | + OBD_MD_FLMODE | OBD_MD_FLNLINK | OBD_MD_FLGENER; if (!S_ISREG(inode->i_mode)) b->valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS | OBD_MD_FLATIME | diff --git a/lustre/obdclass/obdo.c b/lustre/obdclass/obdo.c index d178a4f..63e4a13 100644 --- a/lustre/obdclass/obdo.c +++ b/lustre/obdclass/obdo.c @@ -116,6 +116,10 @@ void iattr_from_obdo(struct iattr *attr, struct obdo *oa, obd_flag valid) attr->ia_gid = oa->o_gid; attr->ia_valid |= ATTR_GID; } + if (valid & OBD_MD_FLFLAGS) { + attr->ia_attr_flags = oa->o_flags; + attr->ia_valid |= ATTR_ATTR_FLAG; + } } EXPORT_SYMBOL(iattr_from_obdo); -- 1.8.3.1