[Ocfs2-tools-devel] [PATCH 08/11] fsck.ocfs2 now know inline data.
Joel Becker
Joel.Becker at oracle.com
Fri Jul 25 01:34:21 PDT 2008
On Wed, Jul 23, 2008 at 06:52:27AM +0800, Tao Ma wrote:
> + if (di->i_dyn_features & OCFS2_INLINE_DATA_FL) {
> + expected = ocfs2_max_inline_data(fs->fs_blocksize);
> +
> + /* i_size is checked for symlinks elsewhere */
> + if (di->i_size > expected &&
> + prompt(ost, PY, PR_INODE_SIZE, "Inode %"PRIu64
> + " has a size of %"PRIu64" which exceeds the max "
> + " inline data size %"PRIu64". "
> + "Correct the file size?",
> + (uint64_t)di->i_blkno, (uint64_t)di->i_size,
> + expected)) {
> + di->i_size = expected;
> + o2fsck_write_inode(ost, blkno, di);
> + }
> +
> + if (di->i_clusters > 0 &&
> + prompt(ost, PY, PR_INODE_CLUSTERS,
> + "Inode %"PRIu64" has %"PRIu32" clusters but it has "
> + "inline data flag set. "
> + "Correct the number of clusters?",
> + (uint64_t)di->i_blkno, di->i_clusters)) {
> + di->i_clusters = 0;
> + o2fsck_write_inode(ost, blkno, di);
> + }
This looks like Mark, you, and I discussed, but there's one
other problem - you aren't checking for FEATURE_INCOMPAT_INLINE_DATA.
So, when you first look at the inode, you should check the feature. If
the feature isn't set but i_dyn_flags has INLINE_DATA_FL, you should ask
about clearing it.
By doing this up front, you can let all your other checks just
check i_dyn_flags; you won't have to check s_feature_incompat
everywhere.
Mark, thoughts?
Joel
--
"You don't make the poor richer by making the rich poorer."
- Sir Winston Churchill
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
More information about the Ocfs2-tools-devel
mailing list