From a86491e47e7e11dc6b2eb11c47387149fed91fc1 Mon Sep 17 00:00:00 2001 From: adilger Date: Mon, 14 Jul 2003 22:37:20 +0000 Subject: [PATCH] Instead of setting all of the valid flags, and then clearing them for regular files if an EA is found, we instead leave them unset for regular files and only set them if we find we do not find an EA. This avoids sending back bad data to the client if we abort early because of error and do not clear the valid flags (POSIX.os/files/open/T.open 31). --- lustre/mds/mds_lib.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lustre/mds/mds_lib.c b/lustre/mds/mds_lib.c index 5ae1e4f..93ac300 100644 --- a/lustre/mds/mds_lib.c +++ b/lustre/mds/mds_lib.c @@ -60,10 +60,12 @@ 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_FLATIME | OBD_MD_FLMTIME | - OBD_MD_FLCTIME | OBD_MD_FLSIZE | OBD_MD_FLBLOCKS | - 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_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 | + OBD_MD_FLMTIME; b->ino = inode->i_ino; b->atime = LTIME_S(inode->i_atime); -- 1.8.3.1