From: adilger Date: Wed, 12 Jan 2000 00:37:38 +0000 (+0000) Subject: ext2obd/ext2obd.c, obdfs/namei.c: fixed inline flag to be o_obdflag, not o_flag X-Git-Tag: v1_7_100~6131 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=f640f0a342e1993dcdecb430624682183d6d9d45;p=fs%2Flustre-release.git ext2obd/ext2obd.c, obdfs/namei.c: fixed inline flag to be o_obdflag, not o_flag - fixes bug with symlinks not being written to disk obdfs/namei.c, ext2obd/ext2obd.c: added "mode" hint for inode creation - fixes bug with ext2 dircount getting out of sync --- diff --git a/lustre/demos/obdfsclean.sh b/lustre/demos/obdfsclean.sh index 19fc321..82a2351 100755 --- a/lustre/demos/obdfsclean.sh +++ b/lustre/demos/obdfsclean.sh @@ -4,7 +4,8 @@ OBDDIR="`dirname $0`/.." . $OBDDIR/demos/config.sh plog umount $MNTOBD -plog killall pupd # stop the OBDFS flush daemon +killall -STOP pupd # stop the OBDFS flush daemon (both signals required) +plog killall pupd rmmod obdfs plog log "CLEANUP/DETACH" diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index dfbf7c7..64b8385 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -266,7 +266,7 @@ static inline void obdo_from_iattr(struct obdo *oa, struct iattr *attr) static __inline__ void obdo_cpy_md(struct obdo *dst, struct obdo *src) { - CDEBUG(D_INODE, "flags 0x%x\n", src->o_valid); + CDEBUG(D_INODE, "src obdo flags 0x%x\n", src->o_valid); if ( src->o_valid & OBD_MD_FLATIME ) dst->o_atime = src->o_atime; if ( src->o_valid & OBD_MD_FLMTIME ) @@ -303,7 +303,7 @@ static __inline__ void obdo_cpy_md(struct obdo *dst, struct obdo *src) static __inline__ void obdo_from_inode(struct obdo *dst, struct inode *src) { - CDEBUG(D_INODE, "flags 0x%08x\n", dst->o_valid); + CDEBUG(D_INODE, "dst obdo flags 0x%08x\n", dst->o_valid); if ( dst->o_valid & OBD_MD_FLID ) dst->o_id = src->i_ino; if ( dst->o_valid & OBD_MD_FLATIME ) @@ -335,7 +335,7 @@ static __inline__ void obdo_from_inode(struct obdo *dst, struct inode *src) static __inline__ void obdo_to_inode(struct inode *dst, struct obdo *src) { - CDEBUG(D_INODE, "flags 0x%08x\n", src->o_valid); + CDEBUG(D_INODE, "src obdo flags 0x%08x\n", src->o_valid); if ( src->o_valid & OBD_MD_FLID ) dst->i_ino = src->o_id; if ( src->o_valid & OBD_MD_FLATIME ) diff --git a/lustre/obdfs/flushd.c b/lustre/obdfs/flushd.c index 2732e44..86c01fa 100644 --- a/lustre/obdfs/flushd.c +++ b/lustre/obdfs/flushd.c @@ -120,7 +120,7 @@ static int pupdate(void *unused) printk("pupdate() activated...\n"); - /* sigstop and sigcont will stop and wakeup kupdate */ + /* sigstop and sigcont will stop and wakeup pupdate */ spin_lock_irq(&tsk->sigmask_lock); sigfillset(&tsk->blocked); siginitsetinv(&tsk->blocked, sigmask(SIGCONT) | sigmask(SIGSTOP)); diff --git a/lustre/obdfs/namei.c b/lustre/obdfs/namei.c index 4ffdbaa..e2c77af 100644 --- a/lustre/obdfs/namei.c +++ b/lustre/obdfs/namei.c @@ -459,7 +459,7 @@ static struct inode *obdfs_new_inode(struct inode *dir, int mode) return ERR_PTR(-ENOMEM); } - /* Send a hint to the create method on the type of file created */ + /* Send a hint to the create method on the type of file to create */ oa->o_mode = mode; oa->o_valid |= OBD_MD_FLMODE; @@ -480,8 +480,6 @@ static struct inode *obdfs_new_inode(struct inode *dir, int mode) return ERR_PTR(-EIO); } - inode->i_mode = mode; /* XXX not sure if we need this or iget does it */ - if (!list_empty(&inode->i_dentry)) { CDEBUG(D_INODE, "New inode (%ld) has aliases!\n", inode->i_ino); IOPS(dir, destroy)(IID(dir), oa); @@ -490,9 +488,8 @@ static struct inode *obdfs_new_inode(struct inode *dir, int mode) EXIT; return ERR_PTR(-EIO); } - - INIT_LIST_HEAD(&OBDFS_LIST(inode)); obdo_free(oa); + INIT_LIST_HEAD(&OBDFS_LIST(inode)); EXIT; return inode; diff --git a/lustre/obdfs/super.c b/lustre/obdfs/super.c index 6e61ea7..6c598a8 100644 --- a/lustre/obdfs/super.c +++ b/lustre/obdfs/super.c @@ -130,7 +130,6 @@ static struct super_block * obdfs_read_super(struct super_block *sb, struct inode *root = 0; struct obdfs_sb_info *sbi = (struct obdfs_sb_info *)(&sb->u.generic_sbp); struct obd_device *obddev; - int error = 0; char *device = NULL; char *version = NULL; int devno; @@ -190,45 +189,39 @@ static struct super_block * obdfs_read_super(struct super_block *sb, sbi->osi_ops = sbi->osi_obd->obd_type->typ_ops; sbi->osi_conn.oc_dev = obddev; - error = sbi->osi_ops->o_connect(&sbi->osi_conn); - if ( error ) { + err = sbi->osi_ops->o_connect(&sbi->osi_conn); + if ( err ) { printk("OBDFS: cannot connect to %s\n", device); - goto error; + goto ERR; } INIT_LIST_HEAD(&sbi->osi_list); sbi->osi_super = sb; - error = sbi->osi_ops->o_get_info(&sbi->osi_conn, - strlen("blocksize"), - "blocksize", - &scratch, (void *)&blocksize); - if ( error ) { + err = sbi->osi_ops->o_get_info(&sbi->osi_conn, strlen("blocksize"), + "blocksize", &scratch, + (void *)&blocksize); + if ( err ) { printk("Getinfo call to drive failed (blocksize)\n"); - goto error; + goto ERR; } - error = sbi->osi_ops->o_get_info(&sbi->osi_conn, - strlen("blocksize_bits"), - "blocksize_bits", - &scratch, (void *)&blocksize_bits); - if ( error ) { + err = sbi->osi_ops->o_get_info(&sbi->osi_conn, strlen("blocksize_bits"), + "blocksize_bits", &scratch, + (void *)&blocksize_bits); + if ( err ) { printk("Getinfo call to drive failed (blocksize_bits)\n"); - goto error; + goto ERR; } - error = sbi->osi_ops->o_get_info(&sbi->osi_conn, - strlen("root_ino"), - "root_ino", - &scratch, (void *)&root_ino); - if ( error ) { + err = sbi->osi_ops->o_get_info(&sbi->osi_conn, strlen("root_ino"), + "root_ino", &scratch, (void *)&root_ino); + if ( err ) { printk("Getinfo call to drive failed (root_ino)\n"); - goto error; + goto ERR; } - - lock_super(sb); sb->s_blocksize = blocksize; @@ -236,17 +229,18 @@ static struct super_block * obdfs_read_super(struct super_block *sb, sb->s_magic = OBDFS_SUPER_MAGIC; sb->s_op = &obdfs_super_operations; + /* XXX how to get "sb->s_flags |= MS_RDONLY" here for snapshots? */ + /* make root inode */ root = iget(sb, root_ino); if (!root || is_bad_inode(root)) { printk("OBDFS: bad iget for root\n"); sb->s_dev = 0; - error = ENOENT; + err = -ENOENT; unlock_super(sb); - goto error; + goto ERR; } - printk("obdfs_read_super: sbdev %d, rootino: %ld, dev %s, " "minor: %d, blocksize: %ld, blocksize bits %ld\n", sb->s_dev, root->i_ino, device, MINOR(devno), @@ -256,7 +250,7 @@ static struct super_block * obdfs_read_super(struct super_block *sb, EXIT; return sb; - error: +ERR: EXIT; MOD_DEC_USE_COUNT; if (sbi) { @@ -295,11 +289,14 @@ static void obdfs_put_super(struct super_block *sb) void inline obdfs_from_inode(struct obdo *oa, struct inode *inode) { obdo_from_inode(oa, inode); + + CDEBUG(D_INODE, "oinfo flags 0x%08x\n", OBDFS_INFO(inode)->oi_flags); if (obdfs_has_inline(inode)) { struct obdfs_inode_info *oinfo = OBDFS_INFO(inode); + CDEBUG(D_INODE, "inode %ld has inline data\n", inode->i_ino); memcpy(oa->o_inline, oinfo->oi_inline, OBD_INLINESZ); - oa->o_flags |= OBD_FL_INLINEDATA; + oa->o_obdflags |= OBD_FL_INLINEDATA; } } @@ -319,7 +316,6 @@ void obdfs_read_inode(struct inode *inode) { struct obdo *oa; int err; - struct obdfs_inode_info *ii; ENTRY; oa = obdo_alloc(); @@ -330,9 +326,8 @@ void obdfs_read_inode(struct inode *inode) } oa->o_valid = ~OBD_MD_FLOBDMD; oa->o_id = inode->i_ino; - ii = (struct obdfs_inode_info *)(&inode->u.generic_ip); - INIT_LIST_HEAD(&ii->oi_pages); + INIT_LIST_HEAD(&OBDFS_INFO(inode)->oi_pages); err = IOPS(inode, getattr)(IID(inode), oa); if (err) {