Re: online resizing of devices/filesystems (2.6)

From: Kevin Corry
Date: Fri Oct 17 2003 - 15:55:58 EST


On Friday 17 October 2003 15:05, Andrew Morton wrote:
> Resizing a blockdev while someone has a filesystem mounted on it is a bit
> rude, but I guess that as long as it is being expanded, not much can go
> wrong.

There's no technical reason why you couldn't shrink as well. But right now we
don't have any filesystems that support online shrink, so the tools prevent
that scenario. Online expand is quite common, though.

> bd_set_size() isn't quite what you want because it fiddles with the
> blocksize as well.

Ok.

> So one approach would be to do what NBD does, and just write i_size
> directly.

We had considered that originally. It just seemed like too big of a hack. :)
Plus I wasn't sure if there were locking issues with changing fields in the
inode.

> You could create a little helper library function which takes i_sem and
> then writes i_size. But the VFS tends to avoid taking i_sem on blockdevs
> because it doesn't expect i_size to change ;)

So...should I take i_sem or not? :) Perhaps calling i_size_write() in
include/linux/fs.h would be preferrable, since it seems to be doing different
things for SMP and preempt.

Thanks for the feedback!
--
Kevin Corry
kevcorry@xxxxxxxxxx
http://evms.sourceforge.net/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/