lkml.org 
[lkml]   [2003]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: online resizing of devices/filesystems (2.6)
Kevin Corry <kevcorry@us.ibm.com> wrote:
>
> On August 21, 2003, Joe Thornber wrote:
> > Hi,
> >
> > Should genhd.h:set_capacity() find and update the i_size field of the
> > inode for the device ?
> >
> > The BLKGETSIZE and BLKGETSIZE64 ioctls report the size in the devices
> > inode:
> >
> > case BLKGETSIZE:
> > if ((bdev->bd_inode->i_size >> 9) > ~0UL)
> > return -EFBIG;
> > return put_ulong(arg, bdev->bd_inode->i_size >> 9);
> > case BLKGETSIZE64:
> > return put_u64(arg, bdev->bd_inode->i_size);
> >
> > Currently people have to close and reopen the device in order for a
> > size change to take effect. This is a problem if people want to do
> > online resizing of a filesystem (supported by xfs and resier).
>
> Has anyone had any thoughts about this issue?

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.

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

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

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 ;)

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

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.035 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site