panic: handle_written_inodeblock: bad size

Jeremy Chadwick freebsd at jdc.parodius.com
Tue Jul 20 17:57:11 UTC 2010


On Tue, Jul 20, 2010 at 08:44:51AM -0700, Kirk McKusick wrote:
> You are on the right track with getting the filesystem information.
> Any place that one has an inode (say pointer ip), it is possible
> to get the filesystem information using ip->i_fs->fs_fsmnt. The
> mount point can also be found from the mount-point structure.

Kirk, thanks for chiming in!

The latter is the one I'm not familiar with.  Are you referring to
"struct mount"?  If so -- yeah I took a look at that one too, but found
it to be used predominantly in other functions and wasn't sure how to
"work backwards" to getting what was needed.

I also wasn't sure what the difference was between fs_fsmnt vs.
f_mntfromname (and f_mnttoname too) in struct mount.

> So, it is almost always possible to make your way to fs_fsmnt.
> Since soft updates only runs on mounted filesystems, you will never
> have a case where the fs_fsmnt has not been filled in for you.

Oh, cool.  I was taking the paranoid approach ("does this really
point to something that's valid?  What if...").  :-)

> You are right that you do not want to add a global variable.
> Instead the fs_fsmnt should just be gathered from where-ever it 
> is available. Adding it to all the panic's will be a lot of work,
> but I agree would be useful. I will look into doing so when I
> get a chance.

I'd like to volunteer to help implement this if at all possible.  I
don't mind doing the dirty work and having you review it.

There are some functions which are fairly obvious when it comes to
getting mountpoint information, and I think a good starting point (for
me anyway) would be to enhance those.

Standardising the panic() output cosmetically (meaning where in the
string the mountpoint gets printed) would also be worthwhile.  I'm
of the opinion that it should be printed first, e.g.:

panic("%s: softdep_setup_inomapdep: dependency for new inode already exists"
	mountpoint);

The biggest problem (for me) is testing.  I have no idea how to
trigger the error conditions in these functions.  I assume it varies;
maybe through fsdb(8) or interactively dropping to DDB and forcing
the condition.

I tend to do all of my work on this sort on a VM of FreeBSD (using
VMware Workstation), but if testing on bare metal is required I
have a testbed as well.

Let me know if you could.  Thanks!

-- 
| Jeremy Chadwick                                   jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |



More information about the freebsd-fs mailing list