Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 314898 Details for
Bug 457798
GFS2 : gfs2meta is FUBAR
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
RHEL5 port of upstream patch
bz457798-RHEL5.patch (text/plain), 37.11 KB, created by
Abhijith Das
on 2008-08-25 04:49:12 UTC
(
hide
)
Description:
RHEL5 port of upstream patch
Filename:
MIME Type:
Creator:
Abhijith Das
Created:
2008-08-25 04:49:12 UTC
Size:
37.11 KB
patch
obsolete
>diff -Nupr a/fs/gfs2/incore.h b/fs/gfs2/incore.h >--- a/fs/gfs2/incore.h 2008-08-20 09:05:27.000000000 -0500 >+++ b/fs/gfs2/incore.h 2008-08-20 16:07:12.000000000 -0500 >@@ -408,14 +408,12 @@ struct gfs2_args { > int ar_quota; /* off/account/on */ > int ar_suiddir; /* suiddir support */ > int ar_data; /* ordered/writeback */ >+ int ar_meta; /* mount metafs */ > }; > > struct gfs2_tune { > spinlock_t gt_spin; > >- unsigned int gt_ilimit; >- unsigned int gt_ilimit_tries; >- unsigned int gt_ilimit_min; > unsigned int gt_demote_secs; /* Cache retention for unheld glock */ > unsigned int gt_incore_log_blocks; > unsigned int gt_log_flush_secs; >@@ -435,10 +433,8 @@ struct gfs2_tune { > unsigned int gt_new_files_jdata; > unsigned int gt_new_files_directio; > unsigned int gt_max_readahead; /* Max bytes to read-ahead from disk */ >- unsigned int gt_lockdump_size; > unsigned int gt_stall_secs; /* Detects trouble! */ > unsigned int gt_complain_secs; >- unsigned int gt_reclaim_limit; /* Max num of glocks in reclaim list */ > unsigned int gt_statfs_quantum; > unsigned int gt_statfs_slow; > }; >@@ -476,7 +472,6 @@ struct gfs2_sb_host { > > struct gfs2_sbd { > struct super_block *sd_vfs; >- struct super_block *sd_vfs_meta; > struct kobject sd_kobj; > unsigned long sd_flags; /* SDF_... */ > struct gfs2_sb_host sd_sb; >@@ -514,7 +509,9 @@ struct gfs2_sbd { > > /* Inode Stuff */ > >- struct inode *sd_master_dir; >+ struct dentry *sd_master_dir; >+ struct dentry *sd_root_dir; >+ > struct inode *sd_jindex; > struct inode *sd_inum_inode; > struct inode *sd_statfs_inode; >@@ -652,7 +649,6 @@ struct gfs2_sbd { > /* Debugging crud */ > > unsigned long sd_last_warning; >- struct vfsmount *sd_gfs2mnt; > struct dentry *debugfs_dir; /* debugfs directory */ > struct dentry *debugfs_dentry_glocks; /* for debugfs */ > }; >diff -Nupr a/fs/gfs2/mount.c b/fs/gfs2/mount.c >--- a/fs/gfs2/mount.c 2008-08-20 09:05:27.000000000 -0500 >+++ b/fs/gfs2/mount.c 2008-08-20 09:07:33.000000000 -0500 >@@ -42,6 +42,7 @@ enum { > Opt_nosuiddir, > Opt_data_writeback, > Opt_data_ordered, >+ Opt_meta, > Opt_err, > }; > >@@ -66,6 +67,7 @@ static match_table_t tokens = { > {Opt_nosuiddir, "nosuiddir"}, > {Opt_data_writeback, "data=writeback"}, > {Opt_data_ordered, "data=ordered"}, >+ {Opt_meta, "meta"}, > {Opt_err, NULL} > }; > >@@ -239,6 +241,11 @@ int gfs2_mount_args(struct gfs2_sbd *sdp > case Opt_data_ordered: > args->ar_data = GFS2_DATA_ORDERED; > break; >+ case Opt_meta: >+ if (remount && args->ar_meta != 1) >+ goto cant_remount; >+ args->ar_meta = 1; >+ break; > case Opt_err: > default: > fs_info(sdp, "unknown option: %s\n", o); >diff -Nupr a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c >--- a/fs/gfs2/ops_fstype.c 2008-08-20 09:05:27.000000000 -0500 >+++ b/fs/gfs2/ops_fstype.c 2008-08-21 09:33:26.000000000 -0500 >@@ -42,6 +42,47 @@ > > extern struct dentry_operations gfs2_dops; > >+static const u32 gfs2_old_fs_formats[] = { >+ 0 >+}; >+ >+static const u32 gfs2_old_multihost_formats[] = { >+ 0 >+}; >+ >+/** >+ * gfs2_tune_init - Fill a gfs2_tune structure with default values >+ * @gt: tune >+ * >+ */ >+ >+static void gfs2_tune_init(struct gfs2_tune *gt) >+{ >+ spin_lock_init(>->gt_spin); >+ >+ gt->gt_demote_secs = 300; >+ gt->gt_incore_log_blocks = 1024; >+ gt->gt_log_flush_secs = 60; >+ gt->gt_jindex_refresh_secs = 60; >+ gt->gt_recoverd_secs = 60; >+ gt->gt_logd_secs = 1; >+ gt->gt_quotad_secs = 5; >+ gt->gt_quota_simul_sync = 64; >+ gt->gt_quota_warn_period = 10; >+ gt->gt_quota_scale_num = 1; >+ gt->gt_quota_scale_den = 1; >+ gt->gt_quota_cache_secs = 300; >+ gt->gt_quota_quantum = 60; >+ gt->gt_atime_quantum = 3600; >+ gt->gt_new_files_jdata = 0; >+ gt->gt_new_files_directio = 0; >+ gt->gt_max_readahead = 1 << 18; >+ gt->gt_stall_secs = 600; >+ gt->gt_complain_secs = 10; >+ gt->gt_statfs_quantum = 30; >+ gt->gt_statfs_slow = 0; >+} >+ > static struct gfs2_sbd *init_sbd(struct super_block *sb) > { > struct gfs2_sbd *sdp; >@@ -117,6 +158,274 @@ static void init_vfs(struct super_block > sb->s_flags |= MS_NOATIME | MS_NODIRATIME; > } > >+/** >+ * gfs2_check_sb - Check superblock >+ * @sdp: the filesystem >+ * @sb: The superblock >+ * @silent: Don't print a message if the check fails >+ * >+ * Checks the version code of the FS is one that we understand how to >+ * read and that the sizes of the various on-disk structures have not >+ * changed. >+ */ >+ >+static int gfs2_check_sb(struct gfs2_sbd *sdp, struct gfs2_sb_host *sb, int silent) >+{ >+ unsigned int x; >+ >+ if (sb->sb_magic != GFS2_MAGIC || >+ sb->sb_type != GFS2_METATYPE_SB) { >+ if (!silent) >+ printk(KERN_WARNING "GFS2: not a GFS2 filesystem\n"); >+ return -EINVAL; >+ } >+ >+ /* If format numbers match exactly, we're done. */ >+ >+ if (sb->sb_fs_format == GFS2_FORMAT_FS && >+ sb->sb_multihost_format == GFS2_FORMAT_MULTI) >+ return 0; >+ >+ if (sb->sb_fs_format != GFS2_FORMAT_FS) { >+ for (x = 0; gfs2_old_fs_formats[x]; x++) >+ if (gfs2_old_fs_formats[x] == sb->sb_fs_format) >+ break; >+ >+ if (!gfs2_old_fs_formats[x]) { >+ printk(KERN_WARNING >+ "GFS2: code version (%u, %u) is incompatible " >+ "with ondisk format (%u, %u)\n", >+ GFS2_FORMAT_FS, GFS2_FORMAT_MULTI, >+ sb->sb_fs_format, sb->sb_multihost_format); >+ printk(KERN_WARNING >+ "GFS2: I don't know how to upgrade this FS\n"); >+ return -EINVAL; >+ } >+ } >+ >+ if (sb->sb_multihost_format != GFS2_FORMAT_MULTI) { >+ for (x = 0; gfs2_old_multihost_formats[x]; x++) >+ if (gfs2_old_multihost_formats[x] == >+ sb->sb_multihost_format) >+ break; >+ >+ if (!gfs2_old_multihost_formats[x]) { >+ printk(KERN_WARNING >+ "GFS2: code version (%u, %u) is incompatible " >+ "with ondisk format (%u, %u)\n", >+ GFS2_FORMAT_FS, GFS2_FORMAT_MULTI, >+ sb->sb_fs_format, sb->sb_multihost_format); >+ printk(KERN_WARNING >+ "GFS2: I don't know how to upgrade this FS\n"); >+ return -EINVAL; >+ } >+ } >+ >+ if (!sdp->sd_args.ar_upgrade) { >+ printk(KERN_WARNING >+ "GFS2: code version (%u, %u) is incompatible " >+ "with ondisk format (%u, %u)\n", >+ GFS2_FORMAT_FS, GFS2_FORMAT_MULTI, >+ sb->sb_fs_format, sb->sb_multihost_format); >+ printk(KERN_INFO >+ "GFS2: Use the \"upgrade\" mount option to upgrade " >+ "the FS\n"); >+ printk(KERN_INFO "GFS2: See the manual for more details\n"); >+ return -EINVAL; >+ } >+ >+ return 0; >+} >+ >+static int end_bio_io_page(struct bio *bio, unsigned int bytes_done, int error) >+{ >+ struct page *page = bio->bi_private; >+ if (bio->bi_size) >+ return 1; >+ if (!error) >+ SetPageUptodate(page); >+ else >+ printk(KERN_WARNING "gfs2: error %d reading superblock\n", error); >+ unlock_page(page); >+ return 0; >+} >+ >+static void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf) >+{ >+ const struct gfs2_sb *str = buf; >+ >+ sb->sb_magic = be32_to_cpu(str->sb_header.mh_magic); >+ sb->sb_type = be32_to_cpu(str->sb_header.mh_type); >+ sb->sb_format = be32_to_cpu(str->sb_header.mh_format); >+ sb->sb_fs_format = be32_to_cpu(str->sb_fs_format); >+ sb->sb_multihost_format = be32_to_cpu(str->sb_multihost_format); >+ sb->sb_bsize = be32_to_cpu(str->sb_bsize); >+ sb->sb_bsize_shift = be32_to_cpu(str->sb_bsize_shift); >+ sb->sb_master_dir.no_addr = be64_to_cpu(str->sb_master_dir.no_addr); >+ sb->sb_master_dir.no_formal_ino = be64_to_cpu(str->sb_master_dir.no_formal_ino); >+ sb->sb_root_dir.no_addr = be64_to_cpu(str->sb_root_dir.no_addr); >+ sb->sb_root_dir.no_formal_ino = be64_to_cpu(str->sb_root_dir.no_formal_ino); >+ >+ memcpy(sb->sb_lockproto, str->sb_lockproto, GFS2_LOCKNAME_LEN); >+ memcpy(sb->sb_locktable, str->sb_locktable, GFS2_LOCKNAME_LEN); >+} >+ >+/** >+ * gfs2_read_super - Read the gfs2 super block from disk >+ * @sdp: The GFS2 super block >+ * @sector: The location of the super block >+ * @error: The error code to return >+ * >+ * This uses the bio functions to read the super block from disk >+ * because we want to be 100% sure that we never read cached data. >+ * A super block is read twice only during each GFS2 mount and is >+ * never written to by the filesystem. The first time its read no >+ * locks are held, and the only details which are looked at are those >+ * relating to the locking protocol. Once locking is up and working, >+ * the sb is read again under the lock to establish the location of >+ * the master directory (contains pointers to journals etc) and the >+ * root directory. >+ * >+ * Returns: 0 on success or error >+ */ >+ >+static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector) >+{ >+ struct super_block *sb = sdp->sd_vfs; >+ struct gfs2_sb *p; >+ struct page *page; >+ struct bio *bio; >+ >+ page = alloc_page(GFP_NOFS); >+ if (unlikely(!page)) >+ return -ENOBUFS; >+ >+ ClearPageUptodate(page); >+ ClearPageDirty(page); >+ lock_page(page); >+ >+ bio = bio_alloc(GFP_NOFS, 1); >+ if (unlikely(!bio)) { >+ __free_page(page); >+ return -ENOBUFS; >+ } >+ >+ bio->bi_sector = sector * (sb->s_blocksize >> 9); >+ bio->bi_bdev = sb->s_bdev; >+ bio_add_page(bio, page, PAGE_SIZE, 0); >+ >+ bio->bi_end_io = end_bio_io_page; >+ bio->bi_private = page; >+ submit_bio(READ_SYNC, bio); >+ wait_on_page_locked(page); >+ bio_put(bio); >+ if (!PageUptodate(page)) { >+ __free_page(page); >+ return -EIO; >+ } >+ p = kmap(page); >+ gfs2_sb_in(&sdp->sd_sb, p); >+ kunmap(page); >+ __free_page(page); >+ return 0; >+} >+/** >+ * gfs2_read_sb - Read super block >+ * @sdp: The GFS2 superblock >+ * @gl: the glock for the superblock (assumed to be held) >+ * @silent: Don't print message if mount fails >+ * >+ */ >+ >+static int gfs2_read_sb(struct gfs2_sbd *sdp, struct gfs2_glock *gl, int silent) >+{ >+ u32 hash_blocks, ind_blocks, leaf_blocks; >+ u32 tmp_blocks; >+ unsigned int x; >+ int error; >+ >+ error = gfs2_read_super(sdp, GFS2_SB_ADDR >> sdp->sd_fsb2bb_shift); >+ if (error) { >+ if (!silent) >+ fs_err(sdp, "can't read superblock\n"); >+ return error; >+ } >+ >+ error = gfs2_check_sb(sdp, &sdp->sd_sb, silent); >+ if (error) >+ return error; >+ >+ sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift - >+ GFS2_BASIC_BLOCK_SHIFT; >+ sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift; >+ sdp->sd_diptrs = (sdp->sd_sb.sb_bsize - >+ sizeof(struct gfs2_dinode)) / sizeof(u64); >+ sdp->sd_inptrs = (sdp->sd_sb.sb_bsize - >+ sizeof(struct gfs2_meta_header)) / sizeof(u64); >+ sdp->sd_jbsize = sdp->sd_sb.sb_bsize - sizeof(struct gfs2_meta_header); >+ sdp->sd_hash_bsize = sdp->sd_sb.sb_bsize / 2; >+ sdp->sd_hash_bsize_shift = sdp->sd_sb.sb_bsize_shift - 1; >+ sdp->sd_hash_ptrs = sdp->sd_hash_bsize / sizeof(u64); >+ sdp->sd_qc_per_block = (sdp->sd_sb.sb_bsize - >+ sizeof(struct gfs2_meta_header)) / >+ sizeof(struct gfs2_quota_change); >+ >+ /* Compute maximum reservation required to add a entry to a directory */ >+ >+ hash_blocks = DIV_ROUND_UP(sizeof(u64) * (1 << GFS2_DIR_MAX_DEPTH), >+ sdp->sd_jbsize); >+ >+ ind_blocks = 0; >+ for (tmp_blocks = hash_blocks; tmp_blocks > sdp->sd_diptrs;) { >+ tmp_blocks = DIV_ROUND_UP(tmp_blocks, sdp->sd_inptrs); >+ ind_blocks += tmp_blocks; >+ } >+ >+ leaf_blocks = 2 + GFS2_DIR_MAX_DEPTH; >+ >+ sdp->sd_max_dirres = hash_blocks + ind_blocks + leaf_blocks; >+ >+ sdp->sd_heightsize[0] = sdp->sd_sb.sb_bsize - >+ sizeof(struct gfs2_dinode); >+ sdp->sd_heightsize[1] = sdp->sd_sb.sb_bsize * sdp->sd_diptrs; >+ for (x = 2;; x++) { >+ u64 space, d; >+ u32 m; >+ >+ space = sdp->sd_heightsize[x - 1] * sdp->sd_inptrs; >+ d = space; >+ m = do_div(d, sdp->sd_inptrs); >+ >+ if (d != sdp->sd_heightsize[x - 1] || m) >+ break; >+ sdp->sd_heightsize[x] = space; >+ } >+ sdp->sd_max_height = x; >+ sdp->sd_heightsize[x] = ~0; >+ gfs2_assert(sdp, sdp->sd_max_height <= GFS2_MAX_META_HEIGHT); >+ >+ sdp->sd_jheightsize[0] = sdp->sd_sb.sb_bsize - >+ sizeof(struct gfs2_dinode); >+ sdp->sd_jheightsize[1] = sdp->sd_jbsize * sdp->sd_diptrs; >+ for (x = 2;; x++) { >+ u64 space, d; >+ u32 m; >+ >+ space = sdp->sd_jheightsize[x - 1] * sdp->sd_inptrs; >+ d = space; >+ m = do_div(d, sdp->sd_inptrs); >+ >+ if (d != sdp->sd_jheightsize[x - 1] || m) >+ break; >+ sdp->sd_jheightsize[x] = space; >+ } >+ sdp->sd_max_jheight = x; >+ sdp->sd_jheightsize[x] = ~0; >+ gfs2_assert(sdp, sdp->sd_max_jheight <= GFS2_MAX_META_HEIGHT); >+ >+ return 0; >+} >+ > static int init_names(struct gfs2_sbd *sdp, int silent) > { > char *proto, *table; >@@ -227,51 +536,59 @@ fail: > return error; > } > >-static inline struct inode *gfs2_lookup_root(struct super_block *sb, >- u64 no_addr) >+static int gfs2_lookup_root(struct super_block *sb, struct dentry **dptr, >+ u64 no_addr, const char *name) > { >- return gfs2_inode_lookup(sb, DT_DIR, no_addr, 0, 0); >+ struct gfs2_sbd *sdp = sb->s_fs_info; >+ struct dentry *dentry; >+ struct inode *inode; >+ >+ inode = gfs2_inode_lookup(sb, DT_DIR, no_addr, 0, 0); >+ if (IS_ERR(inode)) { >+ fs_err(sdp, "can't read in %s inode: %ld\n", name, PTR_ERR(inode)); >+ return PTR_ERR(inode); >+ } >+ dentry = d_alloc_root(inode); >+ if (!dentry) { >+ fs_err(sdp, "can't alloc %s dentry\n", name); >+ iput(inode); >+ return -ENOMEM; >+ } >+ dentry->d_op = &gfs2_dops; >+ *dptr = dentry; >+ return 0; > } > >-static int init_sb(struct gfs2_sbd *sdp, int silent, int undo) >+static int init_sb(struct gfs2_sbd *sdp, int silent) > { > struct super_block *sb = sdp->sd_vfs; > struct gfs2_holder sb_gh; > u64 no_addr; >- struct inode *inode; >- int error = 0; >+ int ret; > >- if (undo) { >- if (sb->s_root) { >- dput(sb->s_root); >- sb->s_root = NULL; >- } >- return 0; >+ ret = gfs2_glock_nq_num(sdp, GFS2_SB_LOCK, &gfs2_meta_glops, >+ LM_ST_SHARED, 0, &sb_gh); >+ if (ret) { >+ fs_err(sdp, "can't acquire superblock glock: %d\n", ret); >+ return ret; > } > >- error = gfs2_glock_nq_num(sdp, GFS2_SB_LOCK, &gfs2_meta_glops, >- LM_ST_SHARED, 0, &sb_gh); >- if (error) { >- fs_err(sdp, "can't acquire superblock glock: %d\n", error); >- return error; >- } >- >- error = gfs2_read_sb(sdp, sb_gh.gh_gl, silent); >- if (error) { >- fs_err(sdp, "can't read superblock: %d\n", error); >+ ret = gfs2_read_sb(sdp, sb_gh.gh_gl, silent); >+ if (ret) { >+ fs_err(sdp, "can't read superblock: %d\n", ret); > goto out; > } > > /* Set up the buffer cache and SB for real */ > if (sdp->sd_sb.sb_bsize < bdev_hardsect_size(sb->s_bdev)) { >- error = -EINVAL; >+ ret = -EINVAL; > fs_err(sdp, "FS block size (%u) is too small for device " > "block size (%u)\n", > sdp->sd_sb.sb_bsize, bdev_hardsect_size(sb->s_bdev)); > goto out; > } > if (sdp->sd_sb.sb_bsize > PAGE_SIZE) { >- error = -EINVAL; >+ ret = -EINVAL; > fs_err(sdp, "FS block size (%u) is too big for machine " > "page size (%u)\n", > sdp->sd_sb.sb_bsize, (unsigned int)PAGE_SIZE); >@@ -281,25 +598,21 @@ static int init_sb(struct gfs2_sbd *sdp, > > /* Get the root inode */ > no_addr = sdp->sd_sb.sb_root_dir.no_addr; >- if (sb->s_type == &gfs2meta_fs_type) >- no_addr = sdp->sd_sb.sb_master_dir.no_addr; >- inode = gfs2_lookup_root(sb, no_addr); >- if (IS_ERR(inode)) { >- error = PTR_ERR(inode); >- fs_err(sdp, "can't read in root inode: %d\n", error); >+ ret = gfs2_lookup_root(sb, &sdp->sd_root_dir, no_addr, "root"); >+ if (ret) > goto out; >- } > >- sb->s_root = d_alloc_root(inode); >- if (!sb->s_root) { >- fs_err(sdp, "can't get root dentry\n"); >- error = -ENOMEM; >- iput(inode); >+ /* Get the master inode */ >+ no_addr = sdp->sd_sb.sb_master_dir.no_addr; >+ ret = gfs2_lookup_root(sb, &sdp->sd_master_dir, no_addr, "master"); >+ if (ret) { >+ dput(sdp->sd_root_dir); >+ goto out; > } >- sb->s_root->d_op = &gfs2_dops; >+ sb->s_root = dget(sdp->sd_args.ar_meta ? sdp->sd_master_dir : sdp->sd_root_dir); > out: > gfs2_glock_dq_uninit(&sb_gh); >- return error; >+ return ret; > } > > /** >@@ -365,6 +678,7 @@ int map_journal_extents(struct gfs2_sbd > > static int init_journal(struct gfs2_sbd *sdp, int undo) > { >+ struct inode *master = sdp->sd_master_dir->d_inode; > struct gfs2_holder ji_gh; > struct task_struct *p; > struct gfs2_inode *ip; >@@ -376,7 +690,7 @@ static int init_journal(struct gfs2_sbd > goto fail_recoverd; > } > >- sdp->sd_jindex = gfs2_lookup_simple(sdp->sd_master_dir, "jindex"); >+ sdp->sd_jindex = gfs2_lookup_simple(master, "jindex"); > if (IS_ERR(sdp->sd_jindex)) { > fs_err(sdp, "can't lookup journal index: %d\n", error); > return PTR_ERR(sdp->sd_jindex); >@@ -498,25 +812,17 @@ static int init_inodes(struct gfs2_sbd * > { > int error = 0; > struct gfs2_inode *ip; >- struct inode *inode; >+ struct inode *master = sdp->sd_master_dir->d_inode; > > if (undo) > goto fail_qinode; > >- inode = gfs2_lookup_root(sdp->sd_vfs, sdp->sd_sb.sb_master_dir.no_addr); >- if (IS_ERR(inode)) { >- error = PTR_ERR(inode); >- fs_err(sdp, "can't read in master directory: %d\n", error); >- goto fail; >- } >- sdp->sd_master_dir = inode; >- > error = init_journal(sdp, undo); > if (error) >- goto fail_master; >+ goto fail; > > /* Read in the master inode number inode */ >- sdp->sd_inum_inode = gfs2_lookup_simple(sdp->sd_master_dir, "inum"); >+ sdp->sd_inum_inode = gfs2_lookup_simple(master, "inum"); > if (IS_ERR(sdp->sd_inum_inode)) { > error = PTR_ERR(sdp->sd_inum_inode); > fs_err(sdp, "can't read in inum inode: %d\n", error); >@@ -525,7 +831,7 @@ static int init_inodes(struct gfs2_sbd * > > > /* Read in the master statfs inode */ >- sdp->sd_statfs_inode = gfs2_lookup_simple(sdp->sd_master_dir, "statfs"); >+ sdp->sd_statfs_inode = gfs2_lookup_simple(master, "statfs"); > if (IS_ERR(sdp->sd_statfs_inode)) { > error = PTR_ERR(sdp->sd_statfs_inode); > fs_err(sdp, "can't read in statfs inode: %d\n", error); >@@ -533,7 +839,7 @@ static int init_inodes(struct gfs2_sbd * > } > > /* Read in the resource index inode */ >- sdp->sd_rindex = gfs2_lookup_simple(sdp->sd_master_dir, "rindex"); >+ sdp->sd_rindex = gfs2_lookup_simple(master, "rindex"); > if (IS_ERR(sdp->sd_rindex)) { > error = PTR_ERR(sdp->sd_rindex); > fs_err(sdp, "can't get resource index inode: %d\n", error); >@@ -544,7 +850,7 @@ static int init_inodes(struct gfs2_sbd * > sdp->sd_rindex_uptodate = 0; > > /* Read in the quota inode */ >- sdp->sd_quota_inode = gfs2_lookup_simple(sdp->sd_master_dir, "quota"); >+ sdp->sd_quota_inode = gfs2_lookup_simple(master, "quota"); > if (IS_ERR(sdp->sd_quota_inode)) { > error = PTR_ERR(sdp->sd_quota_inode); > fs_err(sdp, "can't get quota file inode: %d\n", error); >@@ -563,8 +869,6 @@ fail_inum: > iput(sdp->sd_inum_inode); > fail_journal: > init_journal(sdp, UNDO); >-fail_master: >- iput(sdp->sd_master_dir); > fail: > return error; > } >@@ -575,6 +879,7 @@ static int init_per_node(struct gfs2_sbd > char buf[30]; > int error = 0; > struct gfs2_inode *ip; >+ struct inode *master = sdp->sd_master_dir->d_inode; > > if (sdp->sd_args.ar_spectator) > return 0; >@@ -582,7 +887,7 @@ static int init_per_node(struct gfs2_sbd > if (undo) > goto fail_qc_gh; > >- pn = gfs2_lookup_simple(sdp->sd_master_dir, "per_node"); >+ pn = gfs2_lookup_simple(master, "per_node"); > if (IS_ERR(pn)) { > error = PTR_ERR(pn); > fs_err(sdp, "can't find per_node directory: %d\n", error); >@@ -758,7 +1063,7 @@ static int fill_super(struct super_block > if (error) > goto fail_lm; > >- error = init_sb(sdp, silent, DO); >+ error = init_sb(sdp, silent); > if (error) > goto fail_locking; > >@@ -799,7 +1104,11 @@ fail_per_node: > fail_inodes: > init_inodes(sdp, UNDO); > fail_sb: >- init_sb(sdp, 0, UNDO); >+ if (sdp->sd_root_dir) >+ dput(sdp->sd_root_dir); >+ if (sdp->sd_master_dir) >+ dput(sdp->sd_master_dir); >+ sb->s_root = NULL; > fail_locking: > init_locking(sdp, &mount_gh, UNDO); > fail_lm: >@@ -817,155 +1126,60 @@ fail: > } > > static int gfs2_get_sb(struct file_system_type *fs_type, int flags, >- const char *dev_name, void *data, struct vfsmount *mnt) >-{ >- struct super_block *sb; >- struct gfs2_sbd *sdp; >- int error = get_sb_bdev(fs_type, flags, dev_name, data, fill_super, mnt); >- if (error) >- goto out; >- sb = mnt->mnt_sb; >- sdp = sb->s_fs_info; >- sdp->sd_gfs2mnt = mnt; >-out: >- return error; >-} >- >-static int fill_super_meta(struct super_block *sb, struct super_block *new, >- void *data, int silent) >-{ >- struct gfs2_sbd *sdp = sb->s_fs_info; >- struct inode *inode; >- int error = 0; >- >- new->s_fs_info = sdp; >- sdp->sd_vfs_meta = sb; >- >- init_vfs(new, SDF_NOATIME); >- >- /* Get the master inode */ >- inode = igrab(sdp->sd_master_dir); >- >- new->s_root = d_alloc_root(inode); >- if (!new->s_root) { >- fs_err(sdp, "can't get root dentry\n"); >- error = -ENOMEM; >- iput(inode); >- } else >- new->s_root->d_op = &gfs2_dops; >- >- return error; >-} >- >-static int set_bdev_super(struct super_block *s, void *data) >-{ >- s->s_bdev = data; >- s->s_dev = s->s_bdev->bd_dev; >- return 0; >-} >- >-static int test_bdev_super(struct super_block *s, void *data) >+ const char *dev_name, void *data, struct vfsmount *mnt) > { >- return s->s_bdev == data; >+ return get_sb_bdev(fs_type, flags, dev_name, data, fill_super, mnt); > } > >-static struct super_block* get_gfs2_sb(const char *dev_name) >+static struct super_block *get_gfs2_sb(const char *dev_name) > { >- struct kstat stat; >+ struct super_block *sb; > struct nameidata nd; >- struct file_system_type *fstype; >- struct super_block *sb = NULL, *s; >- struct list_head *l; > int error; > > error = path_lookup(dev_name, LOOKUP_FOLLOW, &nd); > if (error) { >- printk(KERN_WARNING "GFS2: path_lookup on %s returned error\n", >- dev_name); >- goto out; >- } >- error = vfs_getattr(nd.mnt, nd.dentry, &stat); >- >- fstype = get_fs_type("gfs2"); >- list_for_each(l, &fstype->fs_supers) { >- s = list_entry(l, struct super_block, s_instances); >- if ((S_ISBLK(stat.mode) && s->s_dev == stat.rdev) || >- (S_ISDIR(stat.mode) && s == nd.dentry->d_inode->i_sb)) { >- sb = s; >- goto free_nd; >- } >+ printk(KERN_WARNING "GFS2: path_lookup on %s returned error %d\n", >+ dev_name, error); >+ return NULL; > } >- >- printk(KERN_WARNING "GFS2: Unrecognized block device or " >- "mount point %s\n", dev_name); >- >-free_nd: >+ sb = nd.dentry->d_inode->i_sb; >+ if (sb && (sb->s_type == &gfs2_fs_type)) >+ atomic_inc(&sb->s_active); >+ else >+ sb = NULL; > path_release(&nd); >-out: > return sb; > } > > static int gfs2_get_sb_meta(struct file_system_type *fs_type, int flags, > const char *dev_name, void *data, struct vfsmount *mnt) > { >- int error = 0; >- struct super_block *sb = NULL, *new; >+ struct super_block *sb = NULL; > struct gfs2_sbd *sdp; > > sb = get_gfs2_sb(dev_name); > if (!sb) { > printk(KERN_WARNING "GFS2: gfs2 mount does not exist\n"); >- error = -ENOENT; >- goto error; >+ return -ENOENT; > } > sdp = (struct gfs2_sbd*) sb->s_fs_info; >- if (sdp->sd_vfs_meta) { >- printk(KERN_WARNING "GFS2: gfs2meta mount already exists\n"); >- error = -EBUSY; >- goto error; >- } >- down(&sb->s_bdev->bd_mount_sem); >- new = sget(fs_type, test_bdev_super, set_bdev_super, sb->s_bdev); >- up(&sb->s_bdev->bd_mount_sem); >- if (IS_ERR(new)) { >- error = PTR_ERR(new); >- goto error; >- } >- module_put(fs_type->owner); >- new->s_flags = flags; >- strlcpy(new->s_id, sb->s_id, sizeof(new->s_id)); >- sb_set_blocksize(new, sb->s_blocksize); >- error = fill_super_meta(sb, new, data, flags & MS_SILENT ? 1 : 0); >- if (error) { >- up_write(&new->s_umount); >- deactivate_super(new); >- goto error; >- } >- >- new->s_flags |= MS_ACTIVE; >- >- /* Grab a reference to the gfs2 mount point */ >- atomic_inc(&sdp->sd_gfs2mnt->mnt_count); >- return simple_set_mnt(mnt, new); >-error: >- return error; >+ mnt->mnt_sb = sb; >+ mnt->mnt_root = dget(sdp->sd_master_dir); >+ return 0; > } > > static void gfs2_kill_sb(struct super_block *sb) > { >- if (sb->s_fs_info) { >- gfs2_delete_debugfs_file(sb->s_fs_info); >- gfs2_meta_syncfs(sb->s_fs_info); >- } >- kill_block_super(sb); >-} >- >-static void gfs2_kill_sb_meta(struct super_block *sb) >-{ > struct gfs2_sbd *sdp = sb->s_fs_info; >- generic_shutdown_super(sb); >- sdp->sd_vfs_meta = NULL; >- atomic_dec(&sdp->sd_gfs2mnt->mnt_count); >+ gfs2_meta_syncfs(sdp); >+ dput(sdp->sd_root_dir); >+ dput(sdp->sd_master_dir); >+ sdp->sd_root_dir = NULL; >+ sdp->sd_master_dir = NULL; >+ shrink_dcache_sb(sb); >+ kill_block_super(sb); >+ gfs2_delete_debugfs_file(sdp); > } > > struct file_system_type gfs2_fs_type = { >@@ -980,7 +1194,6 @@ struct file_system_type gfs2meta_fs_type > .name = "gfs2meta", > .fs_flags = FS_REQUIRES_DEV, > .get_sb = gfs2_get_sb_meta, >- .kill_sb = gfs2_kill_sb_meta, > .owner = THIS_MODULE, > }; > >diff -Nupr a/fs/gfs2/ops_super.c b/fs/gfs2/ops_super.c >--- a/fs/gfs2/ops_super.c 2008-08-20 09:05:27.000000000 -0500 >+++ b/fs/gfs2/ops_super.c 2008-08-20 09:07:33.000000000 -0500 >@@ -64,6 +64,39 @@ static int gfs2_write_inode(struct inode > } > > /** >+ * gfs2_make_fs_ro - Turn a Read-Write FS into a Read-Only one >+ * @sdp: the filesystem >+ * >+ * Returns: errno >+ */ >+ >+static int gfs2_make_fs_ro(struct gfs2_sbd *sdp) >+{ >+ struct gfs2_holder t_gh; >+ int error; >+ >+ gfs2_quota_sync(sdp); >+ gfs2_statfs_sync(sdp); >+ >+ error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED, GL_NOCACHE, >+ &t_gh); >+ if (error && !test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) >+ return error; >+ >+ gfs2_meta_syncfs(sdp); >+ gfs2_log_shutdown(sdp); >+ >+ clear_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags); >+ >+ if (t_gh.gh_gl) >+ gfs2_glock_dq_uninit(&t_gh); >+ >+ gfs2_quota_cleanup(sdp); >+ >+ return error; >+} >+ >+/** > * gfs2_put_super - Unmount the filesystem > * @sb: The VFS superblock > * >@@ -74,12 +107,6 @@ static void gfs2_put_super(struct super_ > struct gfs2_sbd *sdp = sb->s_fs_info; > int error; > >- if (!sdp) >- return; >- >- if (!strncmp(sb->s_type->name, "gfs2meta", 8)) >- return; /* Nothing to do */ >- > /* Unfreeze the filesystem, if we need to */ > > mutex_lock(&sdp->sd_freeze_lock); >@@ -102,7 +129,6 @@ static void gfs2_put_super(struct super_ > > /* Release stuff */ > >- iput(sdp->sd_master_dir); > iput(sdp->sd_jindex); > iput(sdp->sd_inum_inode); > iput(sdp->sd_statfs_inode); >@@ -334,6 +360,16 @@ static void gfs2_clear_inode(struct inod > } > } > >+static int is_ancestor(const struct dentry *d1, const struct dentry *d2) >+{ >+ do { >+ if (d1 == d2) >+ return 1; >+ d1 = d1->d_parent; >+ } while (!IS_ROOT(d1)); >+ return 0; >+} >+ > /** > * gfs2_show_options - Show mount options for /proc/mounts > * @s: seq_file structure >@@ -347,6 +383,8 @@ static int gfs2_show_options(struct seq_ > struct gfs2_sbd *sdp = mnt->mnt_sb->s_fs_info; > struct gfs2_args *args = &sdp->sd_args; > >+ if (is_ancestor(mnt->mnt_root, sdp->sd_master_dir)) >+ seq_printf(s, ",meta"); > if (args->ar_lockproto[0]) > seq_printf(s, ",lockproto=%s", args->ar_lockproto); > if (args->ar_locktable[0]) >diff -Nupr a/fs/gfs2/super.c b/fs/gfs2/super.c >--- a/fs/gfs2/super.c 2008-08-20 09:05:27.000000000 -0500 >+++ b/fs/gfs2/super.c 2008-08-20 09:39:11.000000000 -0500 >@@ -33,323 +33,6 @@ > #include "trans.h" > #include "util.h" > >-static const u32 gfs2_old_fs_formats[] = { >- 0 >-}; >- >-static const u32 gfs2_old_multihost_formats[] = { >- 0 >-}; >- >-/** >- * gfs2_tune_init - Fill a gfs2_tune structure with default values >- * @gt: tune >- * >- */ >- >-void gfs2_tune_init(struct gfs2_tune *gt) >-{ >- spin_lock_init(>->gt_spin); >- >- gt->gt_ilimit = 100; >- gt->gt_ilimit_tries = 3; >- gt->gt_ilimit_min = 1; >- gt->gt_demote_secs = 300; >- gt->gt_incore_log_blocks = 1024; >- gt->gt_log_flush_secs = 60; >- gt->gt_jindex_refresh_secs = 60; >- gt->gt_recoverd_secs = 60; >- gt->gt_logd_secs = 1; >- gt->gt_quotad_secs = 5; >- gt->gt_quota_simul_sync = 64; >- gt->gt_quota_warn_period = 10; >- gt->gt_quota_scale_num = 1; >- gt->gt_quota_scale_den = 1; >- gt->gt_quota_cache_secs = 300; >- gt->gt_quota_quantum = 60; >- gt->gt_atime_quantum = 3600; >- gt->gt_new_files_jdata = 0; >- gt->gt_new_files_directio = 0; >- gt->gt_max_readahead = 1 << 18; >- gt->gt_lockdump_size = 131072; >- gt->gt_stall_secs = 600; >- gt->gt_complain_secs = 10; >- gt->gt_reclaim_limit = 5000; >- gt->gt_statfs_quantum = 30; >- gt->gt_statfs_slow = 0; >-} >- >-/** >- * gfs2_check_sb - Check superblock >- * @sdp: the filesystem >- * @sb: The superblock >- * @silent: Don't print a message if the check fails >- * >- * Checks the version code of the FS is one that we understand how to >- * read and that the sizes of the various on-disk structures have not >- * changed. >- */ >- >-int gfs2_check_sb(struct gfs2_sbd *sdp, struct gfs2_sb_host *sb, int silent) >-{ >- unsigned int x; >- >- if (sb->sb_magic != GFS2_MAGIC || >- sb->sb_type != GFS2_METATYPE_SB) { >- if (!silent) >- printk(KERN_WARNING "GFS2: not a GFS2 filesystem\n"); >- return -EINVAL; >- } >- >- /* If format numbers match exactly, we're done. */ >- >- if (sb->sb_fs_format == GFS2_FORMAT_FS && >- sb->sb_multihost_format == GFS2_FORMAT_MULTI) >- return 0; >- >- if (sb->sb_fs_format != GFS2_FORMAT_FS) { >- for (x = 0; gfs2_old_fs_formats[x]; x++) >- if (gfs2_old_fs_formats[x] == sb->sb_fs_format) >- break; >- >- if (!gfs2_old_fs_formats[x]) { >- printk(KERN_WARNING >- "GFS2: code version (%u, %u) is incompatible " >- "with ondisk format (%u, %u)\n", >- GFS2_FORMAT_FS, GFS2_FORMAT_MULTI, >- sb->sb_fs_format, sb->sb_multihost_format); >- printk(KERN_WARNING >- "GFS2: I don't know how to upgrade this FS\n"); >- return -EINVAL; >- } >- } >- >- if (sb->sb_multihost_format != GFS2_FORMAT_MULTI) { >- for (x = 0; gfs2_old_multihost_formats[x]; x++) >- if (gfs2_old_multihost_formats[x] == >- sb->sb_multihost_format) >- break; >- >- if (!gfs2_old_multihost_formats[x]) { >- printk(KERN_WARNING >- "GFS2: code version (%u, %u) is incompatible " >- "with ondisk format (%u, %u)\n", >- GFS2_FORMAT_FS, GFS2_FORMAT_MULTI, >- sb->sb_fs_format, sb->sb_multihost_format); >- printk(KERN_WARNING >- "GFS2: I don't know how to upgrade this FS\n"); >- return -EINVAL; >- } >- } >- >- if (!sdp->sd_args.ar_upgrade) { >- printk(KERN_WARNING >- "GFS2: code version (%u, %u) is incompatible " >- "with ondisk format (%u, %u)\n", >- GFS2_FORMAT_FS, GFS2_FORMAT_MULTI, >- sb->sb_fs_format, sb->sb_multihost_format); >- printk(KERN_INFO >- "GFS2: Use the \"upgrade\" mount option to upgrade " >- "the FS\n"); >- printk(KERN_INFO "GFS2: See the manual for more details\n"); >- return -EINVAL; >- } >- >- return 0; >-} >- >- >-static int end_bio_io_page(struct bio *bio, unsigned int bytes_done, int error) >-{ >- struct page *page = bio->bi_private; >- if (bio->bi_size) >- return 1; >- >- if (!error) >- SetPageUptodate(page); >- else >- printk(KERN_WARNING "gfs2: error %d reading superblock\n", error); >- unlock_page(page); >- return 0; >-} >- >-static void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf) >-{ >- const struct gfs2_sb *str = buf; >- >- sb->sb_magic = be32_to_cpu(str->sb_header.mh_magic); >- sb->sb_type = be32_to_cpu(str->sb_header.mh_type); >- sb->sb_format = be32_to_cpu(str->sb_header.mh_format); >- sb->sb_fs_format = be32_to_cpu(str->sb_fs_format); >- sb->sb_multihost_format = be32_to_cpu(str->sb_multihost_format); >- sb->sb_bsize = be32_to_cpu(str->sb_bsize); >- sb->sb_bsize_shift = be32_to_cpu(str->sb_bsize_shift); >- sb->sb_master_dir.no_addr = be64_to_cpu(str->sb_master_dir.no_addr); >- sb->sb_master_dir.no_formal_ino = be64_to_cpu(str->sb_master_dir.no_formal_ino); >- sb->sb_root_dir.no_addr = be64_to_cpu(str->sb_root_dir.no_addr); >- sb->sb_root_dir.no_formal_ino = be64_to_cpu(str->sb_root_dir.no_formal_ino); >- >- memcpy(sb->sb_lockproto, str->sb_lockproto, GFS2_LOCKNAME_LEN); >- memcpy(sb->sb_locktable, str->sb_locktable, GFS2_LOCKNAME_LEN); >-} >- >-/** >- * gfs2_read_super - Read the gfs2 super block from disk >- * @sdp: The GFS2 super block >- * @sector: The location of the super block >- * @error: The error code to return >- * >- * This uses the bio functions to read the super block from disk >- * because we want to be 100% sure that we never read cached data. >- * A super block is read twice only during each GFS2 mount and is >- * never written to by the filesystem. The first time its read no >- * locks are held, and the only details which are looked at are those >- * relating to the locking protocol. Once locking is up and working, >- * the sb is read again under the lock to establish the location of >- * the master directory (contains pointers to journals etc) and the >- * root directory. >- * >- * Returns: 0 on success or error >- */ >- >-int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector) >-{ >- struct super_block *sb = sdp->sd_vfs; >- struct gfs2_sb *p; >- struct page *page; >- struct bio *bio; >- >- page = alloc_page(GFP_KERNEL); >- if (unlikely(!page)) >- return -ENOBUFS; >- >- ClearPageUptodate(page); >- ClearPageDirty(page); >- lock_page(page); >- >- bio = bio_alloc(GFP_KERNEL, 1); >- if (unlikely(!bio)) { >- __free_page(page); >- return -ENOBUFS; >- } >- >- bio->bi_sector = sector * (sb->s_blocksize >> 9); >- bio->bi_bdev = sb->s_bdev; >- bio_add_page(bio, page, PAGE_SIZE, 0); >- >- bio->bi_end_io = end_bio_io_page; >- bio->bi_private = page; >- submit_bio(READ_SYNC, bio); >- wait_on_page_locked(page); >- bio_put(bio); >- if (!PageUptodate(page)) { >- __free_page(page); >- return -EIO; >- } >- p = kmap(page); >- gfs2_sb_in(&sdp->sd_sb, p); >- kunmap(page); >- __free_page(page); >- return 0; >-} >- >-/** >- * gfs2_read_sb - Read super block >- * @sdp: The GFS2 superblock >- * @gl: the glock for the superblock (assumed to be held) >- * @silent: Don't print message if mount fails >- * >- */ >- >-int gfs2_read_sb(struct gfs2_sbd *sdp, struct gfs2_glock *gl, int silent) >-{ >- u32 hash_blocks, ind_blocks, leaf_blocks; >- u32 tmp_blocks; >- unsigned int x; >- int error; >- >- error = gfs2_read_super(sdp, GFS2_SB_ADDR >> sdp->sd_fsb2bb_shift); >- if (error) { >- if (!silent) >- fs_err(sdp, "can't read superblock\n"); >- return error; >- } >- >- error = gfs2_check_sb(sdp, &sdp->sd_sb, silent); >- if (error) >- return error; >- >- sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift - >- GFS2_BASIC_BLOCK_SHIFT; >- sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift; >- sdp->sd_diptrs = (sdp->sd_sb.sb_bsize - >- sizeof(struct gfs2_dinode)) / sizeof(u64); >- sdp->sd_inptrs = (sdp->sd_sb.sb_bsize - >- sizeof(struct gfs2_meta_header)) / sizeof(u64); >- sdp->sd_jbsize = sdp->sd_sb.sb_bsize - sizeof(struct gfs2_meta_header); >- sdp->sd_hash_bsize = sdp->sd_sb.sb_bsize / 2; >- sdp->sd_hash_bsize_shift = sdp->sd_sb.sb_bsize_shift - 1; >- sdp->sd_hash_ptrs = sdp->sd_hash_bsize / sizeof(u64); >- sdp->sd_qc_per_block = (sdp->sd_sb.sb_bsize - >- sizeof(struct gfs2_meta_header)) / >- sizeof(struct gfs2_quota_change); >- >- /* Compute maximum reservation required to add a entry to a directory */ >- >- hash_blocks = DIV_ROUND_UP(sizeof(u64) * (1 << GFS2_DIR_MAX_DEPTH), >- sdp->sd_jbsize); >- >- ind_blocks = 0; >- for (tmp_blocks = hash_blocks; tmp_blocks > sdp->sd_diptrs;) { >- tmp_blocks = DIV_ROUND_UP(tmp_blocks, sdp->sd_inptrs); >- ind_blocks += tmp_blocks; >- } >- >- leaf_blocks = 2 + GFS2_DIR_MAX_DEPTH; >- >- sdp->sd_max_dirres = hash_blocks + ind_blocks + leaf_blocks; >- >- sdp->sd_heightsize[0] = sdp->sd_sb.sb_bsize - >- sizeof(struct gfs2_dinode); >- sdp->sd_heightsize[1] = sdp->sd_sb.sb_bsize * sdp->sd_diptrs; >- for (x = 2;; x++) { >- u64 space, d; >- u32 m; >- >- space = sdp->sd_heightsize[x - 1] * sdp->sd_inptrs; >- d = space; >- m = do_div(d, sdp->sd_inptrs); >- >- if (d != sdp->sd_heightsize[x - 1] || m) >- break; >- sdp->sd_heightsize[x] = space; >- } >- sdp->sd_max_height = x; >- sdp->sd_heightsize[x] = ~0; >- gfs2_assert(sdp, sdp->sd_max_height <= GFS2_MAX_META_HEIGHT); >- >- sdp->sd_jheightsize[0] = sdp->sd_sb.sb_bsize - >- sizeof(struct gfs2_dinode); >- sdp->sd_jheightsize[1] = sdp->sd_jbsize * sdp->sd_diptrs; >- for (x = 2;; x++) { >- u64 space, d; >- u32 m; >- >- space = sdp->sd_jheightsize[x - 1] * sdp->sd_inptrs; >- d = space; >- m = do_div(d, sdp->sd_inptrs); >- >- if (d != sdp->sd_jheightsize[x - 1] || m) >- break; >- sdp->sd_jheightsize[x] = space; >- } >- sdp->sd_max_jheight = x; >- sdp->sd_jheightsize[x] = ~0; >- gfs2_assert(sdp, sdp->sd_max_jheight <= GFS2_MAX_META_HEIGHT); >- >- return 0; >-} >- > /** > * gfs2_jindex_hold - Grab a lock on the jindex > * @sdp: The GFS2 superblock >@@ -591,39 +274,6 @@ fail: > return error; > } > >-/** >- * gfs2_make_fs_ro - Turn a Read-Write FS into a Read-Only one >- * @sdp: the filesystem >- * >- * Returns: errno >- */ >- >-int gfs2_make_fs_ro(struct gfs2_sbd *sdp) >-{ >- struct gfs2_holder t_gh; >- int error; >- >- gfs2_quota_sync(sdp); >- gfs2_statfs_sync(sdp); >- >- error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED, GL_NOCACHE, >- &t_gh); >- if (error && !test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) >- return error; >- >- gfs2_meta_syncfs(sdp); >- gfs2_log_shutdown(sdp); >- >- clear_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags); >- >- if (t_gh.gh_gl) >- gfs2_glock_dq_uninit(&t_gh); >- >- gfs2_quota_cleanup(sdp); >- >- return error; >-} >- > static void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf) > { > const struct gfs2_statfs_change *str = buf; >diff -Nupr a/fs/gfs2/super.h b/fs/gfs2/super.h >--- a/fs/gfs2/super.h 2008-08-20 09:05:27.000000000 -0500 >+++ b/fs/gfs2/super.h 2008-08-20 09:10:09.000000000 -0500 >@@ -12,12 +12,6 @@ > > #include "incore.h" > >-void gfs2_tune_init(struct gfs2_tune *gt); >- >-int gfs2_check_sb(struct gfs2_sbd *sdp, struct gfs2_sb_host *sb, int silent); >-int gfs2_read_sb(struct gfs2_sbd *sdp, struct gfs2_glock *gl, int silent); >-int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector); >- > static inline unsigned int gfs2_jindex_size(struct gfs2_sbd *sdp) > { > unsigned int x; >@@ -39,7 +33,6 @@ int gfs2_lookup_in_master_dir(struct gfs > struct gfs2_inode **ipp); > > int gfs2_make_fs_rw(struct gfs2_sbd *sdp); >-int gfs2_make_fs_ro(struct gfs2_sbd *sdp); > > int gfs2_statfs_init(struct gfs2_sbd *sdp); > void gfs2_statfs_change(struct gfs2_sbd *sdp, >diff -Nupr a/fs/gfs2/sys.c b/fs/gfs2/sys.c >--- a/fs/gfs2/sys.c 2008-08-20 09:05:27.000000000 -0500 >+++ b/fs/gfs2/sys.c 2008-08-20 16:12:10.000000000 -0500 >@@ -430,7 +430,6 @@ TUNE_ATTR(quota_quantum, 0); > TUNE_ATTR(atime_quantum, 0); > TUNE_ATTR(max_readahead, 0); > TUNE_ATTR(complain_secs, 0); >-TUNE_ATTR(reclaim_limit, 0); > TUNE_ATTR(statfs_slow, 0); > TUNE_ATTR(new_files_jdata, 0); > TUNE_ATTR(new_files_directio, 0); >@@ -453,7 +452,6 @@ static struct attribute *tune_attrs[] = > &tune_attr_atime_quantum.attr, > &tune_attr_max_readahead.attr, > &tune_attr_complain_secs.attr, >- &tune_attr_reclaim_limit.attr, > &tune_attr_statfs_slow.attr, > &tune_attr_quota_simul_sync.attr, > &tune_attr_quota_cache_secs.attr,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 457798
:
313463
|
313557
|
313591
|
313671
| 314898