From 927c598bc84856c9cd0dbe7d3357afe585883cb7 Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 30 Jul 2003 20:35:06 +0000 Subject: [PATCH] Ensure OST objids are unique even after a crash by using the mount count as a generation number. Remove old "superhack" code. Add a "force_sync" parameter to filter_update_server_data() and fsfilt_write_record() so that we ensure the mount_count is safe on disk when the OST has started. b=294 r=phil --- lustre/include/linux/lustre_fsfilt.h | 8 +++++--- lustre/obdclass/fsfilt_ext3.c | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lustre/include/linux/lustre_fsfilt.h b/lustre/include/linux/lustre_fsfilt.h index 72b2292..26895d9 100644 --- a/lustre/include/linux/lustre_fsfilt.h +++ b/lustre/include/linux/lustre_fsfilt.h @@ -61,7 +61,8 @@ struct fsfilt_operations { int (* fs_sync)(struct super_block *sb); int (* fs_prep_san_write)(struct inode *inode, long *blocks, int nblocks, loff_t newsize); - int (* fs_write_record)(struct file *, void *, int size, loff_t *); + int (* fs_write_record)(struct file *, void *, int size, loff_t *, + int force_sync); int (* fs_read_record)(struct file *, void *, int size, loff_t *); }; @@ -212,9 +213,10 @@ static inline int fsfilt_read_record(struct obd_device *obd, struct file *file, } static inline int fsfilt_write_record(struct obd_device *obd, struct file *file, - void *buf, loff_t size, loff_t *offs) + void *buf, loff_t size, loff_t *offs, + int force_sync) { - return obd->obd_fsops->fs_write_record(file, buf, size, offs); + return obd->obd_fsops->fs_write_record(file, buf, size,offs,force_sync); } #endif /* __KERNEL__ */ diff --git a/lustre/obdclass/fsfilt_ext3.c b/lustre/obdclass/fsfilt_ext3.c index eca44d0..55f14d4 100644 --- a/lustre/obdclass/fsfilt_ext3.c +++ b/lustre/obdclass/fsfilt_ext3.c @@ -550,8 +550,8 @@ static int fsfilt_ext3_read_record(struct file * file, void *buf, return size; } -static int fsfilt_ext3_write_record(struct file * file, void *buf, - int size, loff_t *offs) +static int fsfilt_ext3_write_record(struct file *file, void *buf, int size, + loff_t *offs, int force_sync) { struct buffer_head *bh; unsigned long block, boffs; @@ -610,6 +610,9 @@ static int fsfilt_ext3_write_record(struct file * file, void *buf, goto out; } err = size; + + if (force_sync) + handle->h_sync = 1; /* recovery likes this */ out: if (bh) brelse(bh); -- 1.8.3.1