* [PATCH] btrfs: Add a new mount option to grow the FS to the limit of the device
@ 2010-08-02 8:42 Donggeun Kim
2010-08-03 11:49 ` Chris Mason
0 siblings, 1 reply; 8+ messages in thread
From: Donggeun Kim @ 2010-08-02 8:42 UTC (permalink / raw)
To: linux-btrfs; +Cc: chris.mason, kyungmin.park
In some cases, resizing a file system to the maximum device size is required.
When flashing a file system image to a block device,
the file system does not fit into the block device's size.
Currently, executing 'btrfsctl' application is the only way
to grow the file system to the limit of the device.
If the mount option which alters the device size of a file system
to the limit of the device is supported,
it can be useful regardless of the existence of 'btrfsctl' program.
This patch allows the file system to grow to the maximum size of the device
on mount time.
The new mount option name is 'maxsize'.
Thank you.
Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
---
fs/btrfs/ctree.h | 1 +
fs/btrfs/disk-io.c | 30 ++++++++++++++++++++++++++++++
fs/btrfs/super.c | 8 +++++++-
3 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index e9bf864..ee71964 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1192,6 +1192,7 @@ struct btrfs_root {
#define BTRFS_MOUNT_NOSSD (1 << 9)
#define BTRFS_MOUNT_DISCARD (1 << 10)
#define BTRFS_MOUNT_FORCE_COMPRESS (1 << 11)
+#define BTRFS_MOUNT_MAXSIZE (1 << 12)
#define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt)
#define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 34f7c37..a1abf7c 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1533,6 +1533,9 @@ struct btrfs_root *open_ctree(struct super_block *sb,
u32 stripesize;
u64 generation;
u64 features;
+ u64 dev_max_size;
+ u64 dev_old_size;
+ u64 devid;
struct btrfs_key location;
struct buffer_head *bh;
struct btrfs_root *extent_root = kzalloc(sizeof(struct btrfs_root),
@@ -1554,6 +1557,9 @@ struct btrfs_root *open_ctree(struct super_block *sb,
struct btrfs_super_block *disk_super;
+ struct btrfs_trans_handle *trans;
+ struct btrfs_device *device;
+
if (!extent_root || !tree_root || !fs_info ||
!chunk_root || !dev_root || !csum_root) {
err = -ENOMEM;
@@ -1928,6 +1934,30 @@ struct btrfs_root *open_ctree(struct super_block *sb,
btrfs_set_opt(fs_info->mount_opt, SSD);
}
+ if (btrfs_test_opt(tree_root, MAXSIZE)) {
+ devid = fs_devices->latest_devid;
+ device = btrfs_find_device(tree_root, devid, NULL, NULL);
+ if (!device) {
+ printk(KERN_WARNING "resizer unable to "
+ "find device %llu\n",
+ (unsigned long long)devid);
+ goto fail_trans_kthread;
+ }
+ dev_max_size = device->bdev->bd_inode->i_size;
+ dev_old_size = device->total_bytes;
+ if (dev_max_size > dev_old_size) {
+ trans = btrfs_start_transaction(tree_root, 0);
+ ret = btrfs_grow_device(trans, device, dev_max_size);
+ if (ret)
+ printk(KERN_INFO "unable to resize for %s\n",
+ device->name);
+ else
+ printk(KERN_INFO "new size for %s is %llu\n",
+ device->name, dev_max_size);
+ btrfs_commit_transaction(trans, tree_root);
+ }
+ }
+
if (btrfs_super_log_root(disk_super) != 0) {
u64 bytenr = btrfs_super_log_root(disk_super);
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 859ddaa..d6b8cf2 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -68,7 +68,7 @@ enum {
Opt_nodatacow, Opt_max_inline, Opt_alloc_start, Opt_nobarrier, Opt_ssd,
Opt_nossd, Opt_ssd_spread, Opt_thread_pool, Opt_noacl, Opt_compress,
Opt_compress_force, Opt_notreelog, Opt_ratio, Opt_flushoncommit,
- Opt_discard, Opt_err,
+ Opt_discard, Opt_maxsize, Opt_err,
};
static match_table_t tokens = {
@@ -92,6 +92,7 @@ static match_table_t tokens = {
{Opt_flushoncommit, "flushoncommit"},
{Opt_ratio, "metadata_ratio=%d"},
{Opt_discard, "discard"},
+ {Opt_maxsize, "maxsize"},
{Opt_err, NULL},
};
@@ -235,6 +236,9 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
case Opt_discard:
btrfs_set_opt(info->mount_opt, DISCARD);
break;
+ case Opt_maxsize:
+ btrfs_set_opt(info->mount_opt, MAXSIZE);
+ break;
case Opt_err:
printk(KERN_INFO "btrfs: unrecognized mount option "
"'%s'\n", p);
@@ -541,6 +545,8 @@ static int btrfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
seq_puts(seq, ",flushoncommit");
if (btrfs_test_opt(root, DISCARD))
seq_puts(seq, ",discard");
+ if (btrfs_test_opt(root, MAXSIZE))
+ seq_puts(seq, ",maxsize");
if (!(root->fs_info->sb->s_flags & MS_POSIXACL))
seq_puts(seq, ",noacl");
return 0;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] btrfs: Add a new mount option to grow the FS to the limit of the device
2010-08-02 8:42 [PATCH] btrfs: Add a new mount option to grow the FS to the limit of the device Donggeun Kim
@ 2010-08-03 11:49 ` Chris Mason
2010-08-04 11:34 ` Donggeun Kim
0 siblings, 1 reply; 8+ messages in thread
From: Chris Mason @ 2010-08-03 11:49 UTC (permalink / raw)
To: Donggeun Kim; +Cc: linux-btrfs, kyungmin.park
On Mon, Aug 02, 2010 at 05:42:00PM +0900, Donggeun Kim wrote:
> In some cases, resizing a file system to the maximum device size is required.
> When flashing a file system image to a block device,
> the file system does not fit into the block device's size.
> Currently, executing 'btrfsctl' application is the only way
> to grow the file system to the limit of the device.
> If the mount option which alters the device size of a file system
> to the limit of the device is supported,
> it can be useful regardless of the existence of 'btrfsctl' program.
> This patch allows the file system to grow to the maximum size of the device
> on mount time.
> The new mount option name is 'maxsize'.
I think this is a very useful feature, but could you please change the
patch to allow controlling which device is resized?
The ioctl allows you to pass in a device number (where the number comes
from btrfs-show)
Thanks!
-chris
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] btrfs: Add a new mount option to grow the FS to the limit of the device
2010-08-03 11:49 ` Chris Mason
@ 2010-08-04 11:34 ` Donggeun Kim
2010-08-04 13:30 ` Chris Mason
0 siblings, 1 reply; 8+ messages in thread
From: Donggeun Kim @ 2010-08-04 11:34 UTC (permalink / raw)
To: Chris Mason; +Cc: linux-btrfs, kyungmin.park
Chris Mason wrote:
> On Mon, Aug 02, 2010 at 05:42:00PM +0900, Donggeun Kim wrote:
>> In some cases, resizing a file system to the maximum device size is required.
>> When flashing a file system image to a block device,
>> the file system does not fit into the block device's size.
>> Currently, executing 'btrfsctl' application is the only way
>> to grow the file system to the limit of the device.
>> If the mount option which alters the device size of a file system
>> to the limit of the device is supported,
>> it can be useful regardless of the existence of 'btrfsctl' program.
>> This patch allows the file system to grow to the maximum size of the device
>> on mount time.
>> The new mount option name is 'maxsize'.
>
> I think this is a very useful feature, but could you please change the
> patch to allow controlling which device is resized?
>
> The ioctl allows you to pass in a device number (where the number comes
> from btrfs-show)
>
> Thanks!
>
> -chris
>
I'm sorry not to fully understand your comment.
Do you mean that device file name for being resized is specified after 'maxsize' mount option?
e.g) #mount -o maxsize=/dev/sda1 ...
Thank you.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] btrfs: Add a new mount option to grow the FS to the limit of the device
2010-08-04 11:34 ` Donggeun Kim
@ 2010-08-04 13:30 ` Chris Mason
2010-08-04 13:45 ` Kyungmin Park
0 siblings, 1 reply; 8+ messages in thread
From: Chris Mason @ 2010-08-04 13:30 UTC (permalink / raw)
To: Donggeun Kim; +Cc: linux-btrfs, kyungmin.park
On Wed, Aug 04, 2010 at 08:34:43PM +0900, Donggeun Kim wrote:
> Chris Mason wrote:
> > On Mon, Aug 02, 2010 at 05:42:00PM +0900, Donggeun Kim wrote:
> >> In some cases, resizing a file system to the maximum device size is required.
> >> When flashing a file system image to a block device,
> >> the file system does not fit into the block device's size.
> >> Currently, executing 'btrfsctl' application is the only way
> >> to grow the file system to the limit of the device.
> >> If the mount option which alters the device size of a file system
> >> to the limit of the device is supported,
> >> it can be useful regardless of the existence of 'btrfsctl' program.
> >> This patch allows the file system to grow to the maximum size of the device
> >> on mount time.
> >> The new mount option name is 'maxsize'.
> >
> > I think this is a very useful feature, but could you please change the
> > patch to allow controlling which device is resized?
> >
> > The ioctl allows you to pass in a device number (where the number comes
> > from btrfs-show)
> >
> > Thanks!
> >
> > -chris
> >
> I'm sorry not to fully understand your comment.
> Do you mean that device file name for being resized is specified after 'maxsize' mount option?
> e.g) #mount -o maxsize=/dev/sda1 ...
In the resize ioctl you can pass a device number, something like 2:max,
which allows you to say make device #2 the full size of the device.
btrfs-show can be used to find the correct device number for a given
disk. We don't use the device name because the scan might have found a
different device name to tie into the FS.
Thanks,
Chris
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] btrfs: Add a new mount option to grow the FS to the limit of the device
2010-08-04 13:30 ` Chris Mason
@ 2010-08-04 13:45 ` Kyungmin Park
2010-08-04 13:47 ` Chris Mason
0 siblings, 1 reply; 8+ messages in thread
From: Kyungmin Park @ 2010-08-04 13:45 UTC (permalink / raw)
To: Chris Mason, Donggeun Kim, linux-btrfs, kyungmin.park
On Wed, Aug 4, 2010 at 10:30 PM, Chris Mason <chris.mason@oracle.com> w=
rote:
> On Wed, Aug 04, 2010 at 08:34:43PM +0900, Donggeun Kim wrote:
>> Chris Mason wrote:
>> > On Mon, Aug 02, 2010 at 05:42:00PM +0900, Donggeun Kim wrote:
>> >> In some cases, resizing a file system to the maximum device size =
is required.
>> >> When flashing a file system image to a block device,
>> >> the file system does not fit into the block device's size.
>> >> Currently, executing 'btrfsctl' application is the only way
>> >> to grow the file system to the limit of the device.
>> >> If the mount option which alters the device size of a file system
>> >> to the limit of the device is supported,
>> >> it can be useful regardless of the existence of 'btrfsctl' progra=
m.
>> >> This patch allows the file system to grow to the maximum size of =
the device
>> >> on mount time.
>> >> The new mount option name is 'maxsize'.
>> >
>> > I think this is a very useful feature, but could you please change=
the
>> > patch to allow controlling which device is resized?
>> >
>> > The ioctl allows you to pass in a device number (where the number =
comes
>> > from btrfs-show)
>> >
>> > Thanks!
>> >
>> > -chris
>> >
>> I'm sorry not to fully understand your comment.
>> Do you mean that device file name for being resized is specified aft=
er 'maxsize' mount option?
>> e.g) #mount -o maxsize=3D/dev/sda1 ...
>
> In the resize ioctl you can pass a device number, something like 2:ma=
x,
> which allows you to say make device #2 the full size of the device.
>
> btrfs-show can be used to find the correct device number for a given
> disk. =A0We don't use the device name because the scan might have fou=
nd a
> different device name to tie into the FS.
>
> Thanks,
> Chris
Before comments this issues. I first explain why this feature implement=
ed.
As you know, we implement the build image from some specific
directory. the size is maybe small than designed devices. e.g., build
image got the 400MiB but real device size has more the 8GiB.
after program the btrfs image, then it will be expanded at first boot o=
nly.
Initial draft design is that add the some flag at build image. then it
checks it at first mount time. and expand to device size.
But after some study we know that btrfs supports resize feature. So we
implement it as patch.
Anyway that's our requirement.
as you provided usage, can you use the ioctl to achieve this
requirement? if not, we need to another method.
Please give your ideas.
Thank you,
Kyungmin Park
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] btrfs: Add a new mount option to grow the FS to the limit of the device
2010-08-04 13:45 ` Kyungmin Park
@ 2010-08-04 13:47 ` Chris Mason
2010-08-04 13:56 ` Kyungmin Park
0 siblings, 1 reply; 8+ messages in thread
From: Chris Mason @ 2010-08-04 13:47 UTC (permalink / raw)
To: Kyungmin Park; +Cc: Donggeun Kim, linux-btrfs, kyungmin.park
On Wed, Aug 04, 2010 at 10:45:00PM +0900, Kyungmin Park wrote:
> On Wed, Aug 4, 2010 at 10:30 PM, Chris Mason <chris.mason@oracle.com>=
wrote:
> > On Wed, Aug 04, 2010 at 08:34:43PM +0900, Donggeun Kim wrote:
> >> Chris Mason wrote:
> >> > On Mon, Aug 02, 2010 at 05:42:00PM +0900, Donggeun Kim wrote:
> >> >> In some cases, resizing a file system to the maximum device siz=
e is required.
> >> >> When flashing a file system image to a block device,
> >> >> the file system does not fit into the block device's size.
> >> >> Currently, executing 'btrfsctl' application is the only way
> >> >> to grow the file system to the limit of the device.
> >> >> If the mount option which alters the device size of a file syst=
em
> >> >> to the limit of the device is supported,
> >> >> it can be useful regardless of the existence of 'btrfsctl' prog=
ram.
> >> >> This patch allows the file system to grow to the maximum size o=
f the device
> >> >> on mount time.
> >> >> The new mount option name is 'maxsize'.
> >> >
> >> > I think this is a very useful feature, but could you please chan=
ge the
> >> > patch to allow controlling which device is resized?
> >> >
> >> > The ioctl allows you to pass in a device number (where the numbe=
r comes
> >> > from btrfs-show)
> >> >
> >> > Thanks!
> >> >
> >> > -chris
> >> >
> >> I'm sorry not to fully understand your comment.
> >> Do you mean that device file name for being resized is specified a=
fter 'maxsize' mount option?
> >> e.g) #mount -o maxsize=3D/dev/sda1 ...
> >
> > In the resize ioctl you can pass a device number, something like 2:=
max,
> > which allows you to say make device #2 the full size of the device.
> >
> > btrfs-show can be used to find the correct device number for a give=
n
> > disk. =A0We don't use the device name because the scan might have f=
ound a
> > different device name to tie into the FS.
> >
> > Thanks,
> > Chris
>=20
> Before comments this issues. I first explain why this feature impleme=
nted.
>=20
> As you know, we implement the build image from some specific
> directory. the size is maybe small than designed devices. e.g., build
> image got the 400MiB but real device size has more the 8GiB.
> after program the btrfs image, then it will be expanded at first boot=
only.
Yes, and this makes a lot of sense to me. I can see how the patch fits
your usage and that you don't need the extra flag to pick a device on
mounting.
>=20
> Initial draft design is that add the some flag at build image. then i=
t
> checks it at first mount time. and expand to device size.
> But after some study we know that btrfs supports resize feature. So w=
e
> implement it as patch.
> Anyway that's our requirement.
>=20
> as you provided usage, can you use the ioctl to achieve this
> requirement? if not, we need to another method.
Yes, the ioctl can currently pick a device to resize. In your case,
there will only be one device and this isn't an issue. But, I'd like t=
o
see parity between what the mount option can do and what the ioctl can
do, just so we are a little more consistent.
-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] btrfs: Add a new mount option to grow the FS to the limit of the device
2010-08-04 13:47 ` Chris Mason
@ 2010-08-04 13:56 ` Kyungmin Park
2010-08-04 14:52 ` Chris Mason
0 siblings, 1 reply; 8+ messages in thread
From: Kyungmin Park @ 2010-08-04 13:56 UTC (permalink / raw)
To: Chris Mason, Kyungmin Park, Donggeun Kim, linux-btrfs,
kyungmin.park
On Wed, Aug 4, 2010 at 10:47 PM, Chris Mason <chris.mason@oracle.com> w=
rote:
> On Wed, Aug 04, 2010 at 10:45:00PM +0900, Kyungmin Park wrote:
>> On Wed, Aug 4, 2010 at 10:30 PM, Chris Mason <chris.mason@oracle.com=
> wrote:
>> > On Wed, Aug 04, 2010 at 08:34:43PM +0900, Donggeun Kim wrote:
>> >> Chris Mason wrote:
>> >> > On Mon, Aug 02, 2010 at 05:42:00PM +0900, Donggeun Kim wrote:
>> >> >> In some cases, resizing a file system to the maximum device si=
ze is required.
>> >> >> When flashing a file system image to a block device,
>> >> >> the file system does not fit into the block device's size.
>> >> >> Currently, executing 'btrfsctl' application is the only way
>> >> >> to grow the file system to the limit of the device.
>> >> >> If the mount option which alters the device size of a file sys=
tem
>> >> >> to the limit of the device is supported,
>> >> >> it can be useful regardless of the existence of 'btrfsctl' pro=
gram.
>> >> >> This patch allows the file system to grow to the maximum size =
of the device
>> >> >> on mount time.
>> >> >> The new mount option name is 'maxsize'.
>> >> >
>> >> > I think this is a very useful feature, but could you please cha=
nge the
>> >> > patch to allow controlling which device is resized?
>> >> >
>> >> > The ioctl allows you to pass in a device number (where the numb=
er comes
>> >> > from btrfs-show)
>> >> >
>> >> > Thanks!
>> >> >
>> >> > -chris
>> >> >
>> >> I'm sorry not to fully understand your comment.
>> >> Do you mean that device file name for being resized is specified =
after 'maxsize' mount option?
>> >> e.g) #mount -o maxsize=3D/dev/sda1 ...
>> >
>> > In the resize ioctl you can pass a device number, something like 2=
:max,
>> > which allows you to say make device #2 the full size of the device=
=2E
>> >
>> > btrfs-show can be used to find the correct device number for a giv=
en
>> > disk. =A0We don't use the device name because the scan might have =
found a
>> > different device name to tie into the FS.
>> >
>> > Thanks,
>> > Chris
>>
>> Before comments this issues. I first explain why this feature implem=
ented.
>>
>> As you know, we implement the build image from some specific
>> directory. the size is maybe small than designed devices. e.g., buil=
d
>> image got the 400MiB but real device size has more the 8GiB.
>> after program the btrfs image, then it will be expanded at first boo=
t only.
>
> Yes, and this makes a lot of sense to me. =A0I can see how the patch =
fits
> your usage and that you don't need the extra flag to pick a device on
> mounting.
>
>>
>> Initial draft design is that add the some flag at build image. then =
it
>> checks it at first mount time. and expand to device size.
>> But after some study we know that btrfs supports resize feature. So =
we
>> implement it as patch.
>> Anyway that's our requirement.
>>
>> as you provided usage, can you use the ioctl to achieve this
>> requirement? if not, we need to another method.
>
> Yes, the ioctl can currently pick a device to resize. =A0In your case=
,
> there will only be one device and this isn't an issue. =A0But, I'd li=
ke to
> see parity between what the mount option can do and what the ioctl ca=
n
> do, just so we are a little more consistent.
>
Then when call the ioctl? in the phone. the boot script is almost
fixed. and not easy to check first boot.
Mr. Kim said the check real size happen every time at mount if apply
patch. but it don't take time if it's already expanded. I think ioctl
has also same problem. if we use this method.
I don't want to call ioctl at every boot time. does it just my hope?
Thank you,
Kyungmin Park
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] btrfs: Add a new mount option to grow the FS to the limit of the device
2010-08-04 13:56 ` Kyungmin Park
@ 2010-08-04 14:52 ` Chris Mason
0 siblings, 0 replies; 8+ messages in thread
From: Chris Mason @ 2010-08-04 14:52 UTC (permalink / raw)
To: Kyungmin Park; +Cc: Donggeun Kim, linux-btrfs, kyungmin.park
On Wed, Aug 04, 2010 at 10:56:18PM +0900, Kyungmin Park wrote:
> On Wed, Aug 4, 2010 at 10:47 PM, Chris Mason <chris.mason@oracle.com>=
wrote:
> > On Wed, Aug 04, 2010 at 10:45:00PM +0900, Kyungmin Park wrote:
> >> On Wed, Aug 4, 2010 at 10:30 PM, Chris Mason <chris.mason@oracle.c=
om> wrote:
> >> > On Wed, Aug 04, 2010 at 08:34:43PM +0900, Donggeun Kim wrote:
> >> >> Chris Mason wrote:
> >> >> > On Mon, Aug 02, 2010 at 05:42:00PM +0900, Donggeun Kim wrote:
> >> >> >> In some cases, resizing a file system to the maximum device =
size is required.
> >> >> >> When flashing a file system image to a block device,
> >> >> >> the file system does not fit into the block device's size.
> >> >> >> Currently, executing 'btrfsctl' application is the only way
> >> >> >> to grow the file system to the limit of the device.
> >> >> >> If the mount option which alters the device size of a file s=
ystem
> >> >> >> to the limit of the device is supported,
> >> >> >> it can be useful regardless of the existence of 'btrfsctl' p=
rogram.
> >> >> >> This patch allows the file system to grow to the maximum siz=
e of the device
> >> >> >> on mount time.
> >> >> >> The new mount option name is 'maxsize'.
> >> >> >
> >> >> > I think this is a very useful feature, but could you please c=
hange the
> >> >> > patch to allow controlling which device is resized?
> >> >> >
> >> >> > The ioctl allows you to pass in a device number (where the nu=
mber comes
> >> >> > from btrfs-show)
> >> >> >
> >> >> > Thanks!
> >> >> >
> >> >> > -chris
> >> >> >
> >> >> I'm sorry not to fully understand your comment.
> >> >> Do you mean that device file name for being resized is specifie=
d after 'maxsize' mount option?
> >> >> e.g) #mount -o maxsize=3D/dev/sda1 ...
> >> >
> >> > In the resize ioctl you can pass a device number, something like=
2:max,
> >> > which allows you to say make device #2 the full size of the devi=
ce.
> >> >
> >> > btrfs-show can be used to find the correct device number for a g=
iven
> >> > disk. =A0We don't use the device name because the scan might hav=
e found a
> >> > different device name to tie into the FS.
> >> >
> >> > Thanks,
> >> > Chris
> >>
> >> Before comments this issues. I first explain why this feature impl=
emented.
> >>
> >> As you know, we implement the build image from some specific
> >> directory. the size is maybe small than designed devices. e.g., bu=
ild
> >> image got the 400MiB but real device size has more the 8GiB.
> >> after program the btrfs image, then it will be expanded at first b=
oot only.
> >
> > Yes, and this makes a lot of sense to me. =A0I can see how the patc=
h fits
> > your usage and that you don't need the extra flag to pick a device =
on
> > mounting.
> >
> >>
> >> Initial draft design is that add the some flag at build image. the=
n it
> >> checks it at first mount time. and expand to device size.
> >> But after some study we know that btrfs supports resize feature. S=
o we
> >> implement it as patch.
> >> Anyway that's our requirement.
> >>
> >> as you provided usage, can you use the ioctl to achieve this
> >> requirement? if not, we need to another method.
> >
> > Yes, the ioctl can currently pick a device to resize. =A0In your ca=
se,
> > there will only be one device and this isn't an issue. =A0But, I'd =
like to
> > see parity between what the mount option can do and what the ioctl =
can
> > do, just so we are a little more consistent.
> >
>=20
> Then when call the ioctl? in the phone. the boot script is almost
> fixed. and not easy to check first boot.
> Mr. Kim said the check real size happen every time at mount if apply
> patch. but it don't take time if it's already expanded. I think ioctl
> has also same problem. if we use this method.
> I don't want to call ioctl at every boot time. does it just my hope?
Sorry, I didn't explain this very well.
Right now you have mount -o maxsize /dev/xxx
I'd like to keep that functionality unchanged, but make it possible to
also do:
mount -o maxsize=3D2 /dev/xxxx
Which would extend only device id 2.
This would keep similar functionality to what the ioctl can do, but
still let you do it at mount time. Does this make more sense?
-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-08-04 14:52 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-02 8:42 [PATCH] btrfs: Add a new mount option to grow the FS to the limit of the device Donggeun Kim
2010-08-03 11:49 ` Chris Mason
2010-08-04 11:34 ` Donggeun Kim
2010-08-04 13:30 ` Chris Mason
2010-08-04 13:45 ` Kyungmin Park
2010-08-04 13:47 ` Chris Mason
2010-08-04 13:56 ` Kyungmin Park
2010-08-04 14:52 ` Chris Mason
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).