All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args
@ 2009-01-19 12:57 Américo Wang
  2009-01-19 13:03   ` Josef Bacik
  0 siblings, 1 reply; 9+ messages in thread
From: Américo Wang @ 2009-01-19 12:57 UTC (permalink / raw)
  To: linux-btrfs, LKML; +Cc: Chris Mason, Andrew Morton


I found userspace tool, btrfsctl, uses BTRFS_VOL_NAME_MAX, and
it also looks that this one is more proper.

Kill BTRFS_PATH_NAME_MAX since no one will use it.

Signed-off-by: WANG Cong <wangcong@zeuux.org>
Cc: Chris Mason <chris.mason@oracle.com>

---
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index c2aa33e..f229950 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -472,7 +472,7 @@ static int btrfs_ioctl_resize(struct btrfs_root *root, void __user *arg)
 		goto out;
 	}
 
-	vol_args->name[BTRFS_PATH_NAME_MAX] = '\0';
+	vol_args->name[BTRFS_VOL_NAME_MAX] = '\0';
 	namelen = strlen(vol_args->name);
 
 	mutex_lock(&root->fs_info->volume_mutex);
@@ -576,7 +576,7 @@ static noinline int btrfs_ioctl_snap_create(struct file *file,
 		goto out;
 	}
 
-	vol_args->name[BTRFS_PATH_NAME_MAX] = '\0';
+	vol_args->name[BTRFS_VOL_NAME_MAX] = '\0';
 	namelen = strlen(vol_args->name);
 	if (strchr(vol_args->name, '/')) {
 		ret = -EINVAL;
@@ -685,7 +685,7 @@ static long btrfs_ioctl_add_dev(struct btrfs_root *root, void __user *arg)
 		ret = -EFAULT;
 		goto out;
 	}
-	vol_args->name[BTRFS_PATH_NAME_MAX] = '\0';
+	vol_args->name[BTRFS_VOL_NAME_MAX] = '\0';
 	ret = btrfs_init_new_device(root, vol_args->name);
 
 out:
@@ -713,7 +713,7 @@ static long btrfs_ioctl_rm_dev(struct btrfs_root *root, void __user *arg)
 		ret = -EFAULT;
 		goto out;
 	}
-	vol_args->name[BTRFS_PATH_NAME_MAX] = '\0';
+	vol_args->name[BTRFS_VOL_NAME_MAX] = '\0';
 	ret = btrfs_rm_device(root, vol_args->name);
 
 out:
diff --git a/fs/btrfs/ioctl.h b/fs/btrfs/ioctl.h
index b320b10..f5d182a 100644
--- a/fs/btrfs/ioctl.h
+++ b/fs/btrfs/ioctl.h
@@ -22,12 +22,10 @@
 
 #define BTRFS_IOCTL_MAGIC 0x94
 #define BTRFS_VOL_NAME_MAX 255
-#define BTRFS_PATH_NAME_MAX 4087
 
-/* this should be 4k */
 struct btrfs_ioctl_vol_args {
 	__s64 fd;
-	char name[BTRFS_PATH_NAME_MAX + 1];
+	char name[BTRFS_VOL_NAME_MAX + 1];
 };
 
 struct btrfs_ioctl_clone_range_args {
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index db9fb3b..5facdbf 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -593,7 +593,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
 		ret = -EFAULT;
 		goto out;
 	}
-	len = strnlen(vol->name, BTRFS_PATH_NAME_MAX);
+	len = strnlen(vol->name, BTRFS_VOL_NAME_MAX);
 
 	switch (cmd) {
 	case BTRFS_IOC_SCAN_DEV:


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args
  2009-01-19 12:57 [Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args Américo Wang
@ 2009-01-19 13:03   ` Josef Bacik
  0 siblings, 0 replies; 9+ messages in thread
From: Josef Bacik @ 2009-01-19 13:03 UTC (permalink / raw)
  To: Américo Wang; +Cc: linux-btrfs, LKML, Chris Mason, Andrew Morton

On Mon, Jan 19, 2009 at 08:57:32PM +0800, Am=E9rico Wang wrote:
>=20
> I found userspace tool, btrfsctl, uses BTRFS_VOL_NAME_MAX, and
> it also looks that this one is more proper.
>=20
> Kill BTRFS_PATH_NAME_MAX since no one will use it.
>=20

Nope, BTRFS_PATH_NAME_MAX is specifically used for the ioctl stuff, mak=
es the
arguments 4k aligned, this patch is incorrect.  Thanks,

Josef
--
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] 9+ messages in thread

* Re: [Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args
@ 2009-01-19 13:03   ` Josef Bacik
  0 siblings, 0 replies; 9+ messages in thread
From: Josef Bacik @ 2009-01-19 13:03 UTC (permalink / raw)
  To: Américo Wang; +Cc: linux-btrfs, LKML, Chris Mason, Andrew Morton

On Mon, Jan 19, 2009 at 08:57:32PM +0800, Américo Wang wrote:
> 
> I found userspace tool, btrfsctl, uses BTRFS_VOL_NAME_MAX, and
> it also looks that this one is more proper.
> 
> Kill BTRFS_PATH_NAME_MAX since no one will use it.
> 

Nope, BTRFS_PATH_NAME_MAX is specifically used for the ioctl stuff, makes the
arguments 4k aligned, this patch is incorrect.  Thanks,

Josef

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args
  2009-01-19 13:03   ` Josef Bacik
@ 2009-01-19 13:12     ` Américo Wang
  -1 siblings, 0 replies; 9+ messages in thread
From: Américo Wang @ 2009-01-19 13:12 UTC (permalink / raw)
  To: Josef Bacik
  Cc: Américo Wang, linux-btrfs, LKML, Chris Mason, Andrew Morton

On Mon, Jan 19, 2009 at 08:03:37AM -0500, Josef Bacik wrote:
>On Mon, Jan 19, 2009 at 08:57:32PM +0800, Am=C3=A9rico Wang wrote:
>>=20
>> I found userspace tool, btrfsctl, uses BTRFS_VOL_NAME_MAX, and
>> it also looks that this one is more proper.
>>=20
>> Kill BTRFS_PATH_NAME_MAX since no one will use it.
>>=20
>
>Nope, BTRFS_PATH_NAME_MAX is specifically used for the ioctl stuff, ma=
kes the
>arguments 4k aligned, this patch is incorrect.  Thanks,

Ok, then what is BTRFS_VOL_NAME_MAX? :)


--=20
"Against stupidity, the gods themselves, contend in vain."

--
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] 9+ messages in thread

* Re: [Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args
@ 2009-01-19 13:12     ` Américo Wang
  0 siblings, 0 replies; 9+ messages in thread
From: Américo Wang @ 2009-01-19 13:12 UTC (permalink / raw)
  To: Josef Bacik
  Cc: Américo Wang, linux-btrfs, LKML, Chris Mason, Andrew Morton

On Mon, Jan 19, 2009 at 08:03:37AM -0500, Josef Bacik wrote:
>On Mon, Jan 19, 2009 at 08:57:32PM +0800, Américo Wang wrote:
>> 
>> I found userspace tool, btrfsctl, uses BTRFS_VOL_NAME_MAX, and
>> it also looks that this one is more proper.
>> 
>> Kill BTRFS_PATH_NAME_MAX since no one will use it.
>> 
>
>Nope, BTRFS_PATH_NAME_MAX is specifically used for the ioctl stuff, makes the
>arguments 4k aligned, this patch is incorrect.  Thanks,

Ok, then what is BTRFS_VOL_NAME_MAX? :)


-- 
"Against stupidity, the gods themselves, contend in vain."


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args
  2009-01-19 13:12     ` Américo Wang
@ 2009-01-21 15:04       ` Chris Mason
  -1 siblings, 0 replies; 9+ messages in thread
From: Chris Mason @ 2009-01-21 15:04 UTC (permalink / raw)
  To: Américo Wang; +Cc: Josef Bacik, linux-btrfs, LKML, Andrew Morton

On Mon, 2009-01-19 at 21:12 +0800, Am=C3=A9rico Wang wrote:
> On Mon, Jan 19, 2009 at 08:03:37AM -0500, Josef Bacik wrote:
> >On Mon, Jan 19, 2009 at 08:57:32PM +0800, Am=C3=A9rico Wang wrote:
> >>=20
> >> I found userspace tool, btrfsctl, uses BTRFS_VOL_NAME_MAX, and
> >> it also looks that this one is more proper.
> >>=20
> >> Kill BTRFS_PATH_NAME_MAX since no one will use it.
> >>=20
> >
> >Nope, BTRFS_PATH_NAME_MAX is specifically used for the ioctl stuff, =
makes the
> >arguments 4k aligned, this patch is incorrect.  Thanks,
>=20
> Ok, then what is BTRFS_VOL_NAME_MAX? :)

Right now it is only used in the progs.  The disk format doesn't really
have a max there, it is just to keep names usable.  But, we should add =
a
check in the kernel ioctl side, are you interested in sending a patch
for it?

-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] 9+ messages in thread

* Re: [Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args
@ 2009-01-21 15:04       ` Chris Mason
  0 siblings, 0 replies; 9+ messages in thread
From: Chris Mason @ 2009-01-21 15:04 UTC (permalink / raw)
  To: Américo Wang; +Cc: Josef Bacik, linux-btrfs, LKML, Andrew Morton

On Mon, 2009-01-19 at 21:12 +0800, Américo Wang wrote:
> On Mon, Jan 19, 2009 at 08:03:37AM -0500, Josef Bacik wrote:
> >On Mon, Jan 19, 2009 at 08:57:32PM +0800, Américo Wang wrote:
> >> 
> >> I found userspace tool, btrfsctl, uses BTRFS_VOL_NAME_MAX, and
> >> it also looks that this one is more proper.
> >> 
> >> Kill BTRFS_PATH_NAME_MAX since no one will use it.
> >> 
> >
> >Nope, BTRFS_PATH_NAME_MAX is specifically used for the ioctl stuff, makes the
> >arguments 4k aligned, this patch is incorrect.  Thanks,
> 
> Ok, then what is BTRFS_VOL_NAME_MAX? :)

Right now it is only used in the progs.  The disk format doesn't really
have a max there, it is just to keep names usable.  But, we should add a
check in the kernel ioctl side, are you interested in sending a patch
for it?

-chris



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args
  2009-01-21 15:04       ` Chris Mason
@ 2009-01-22 16:11         ` Américo Wang
  -1 siblings, 0 replies; 9+ messages in thread
From: Américo Wang @ 2009-01-22 16:11 UTC (permalink / raw)
  To: Chris Mason; +Cc: Josef Bacik, linux-btrfs, LKML, Andrew Morton

On Wed, Jan 21, 2009 at 10:04:08AM -0500, Chris Mason wrote:
>On Mon, 2009-01-19 at 21:12 +0800, Am=C3=A9rico Wang wrote:
>> On Mon, Jan 19, 2009 at 08:03:37AM -0500, Josef Bacik wrote:
>> >On Mon, Jan 19, 2009 at 08:57:32PM +0800, Am=C3=A9rico Wang wrote:
>> >>=20
>> >> I found userspace tool, btrfsctl, uses BTRFS_VOL_NAME_MAX, and
>> >> it also looks that this one is more proper.
>> >>=20
>> >> Kill BTRFS_PATH_NAME_MAX since no one will use it.
>> >>=20
>> >
>> >Nope, BTRFS_PATH_NAME_MAX is specifically used for the ioctl stuff,=
 makes the
>> >arguments 4k aligned, this patch is incorrect.  Thanks,
>>=20
>> Ok, then what is BTRFS_VOL_NAME_MAX? :)
>
>Right now it is only used in the progs.  The disk format doesn't reall=
y
>have a max there, it is just to keep names usable.  But, we should add=
 a
>check in the kernel ioctl side, are you interested in sending a patch
>for it?
>

Yup, I will do.

Thanks.

--=20
"Against stupidity, the gods themselves, contend in vain."

--
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] 9+ messages in thread

* Re: [Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args
@ 2009-01-22 16:11         ` Américo Wang
  0 siblings, 0 replies; 9+ messages in thread
From: Américo Wang @ 2009-01-22 16:11 UTC (permalink / raw)
  To: Chris Mason; +Cc: Josef Bacik, linux-btrfs, LKML, Andrew Morton

On Wed, Jan 21, 2009 at 10:04:08AM -0500, Chris Mason wrote:
>On Mon, 2009-01-19 at 21:12 +0800, Américo Wang wrote:
>> On Mon, Jan 19, 2009 at 08:03:37AM -0500, Josef Bacik wrote:
>> >On Mon, Jan 19, 2009 at 08:57:32PM +0800, Américo Wang wrote:
>> >> 
>> >> I found userspace tool, btrfsctl, uses BTRFS_VOL_NAME_MAX, and
>> >> it also looks that this one is more proper.
>> >> 
>> >> Kill BTRFS_PATH_NAME_MAX since no one will use it.
>> >> 
>> >
>> >Nope, BTRFS_PATH_NAME_MAX is specifically used for the ioctl stuff, makes the
>> >arguments 4k aligned, this patch is incorrect.  Thanks,
>> 
>> Ok, then what is BTRFS_VOL_NAME_MAX? :)
>
>Right now it is only used in the progs.  The disk format doesn't really
>have a max there, it is just to keep names usable.  But, we should add a
>check in the kernel ioctl side, are you interested in sending a patch
>for it?
>

Yup, I will do.

Thanks.

-- 
"Against stupidity, the gods themselves, contend in vain."


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-01-22 16:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-19 12:57 [Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args Américo Wang
2009-01-19 13:03 ` Josef Bacik
2009-01-19 13:03   ` Josef Bacik
2009-01-19 13:12   ` Américo Wang
2009-01-19 13:12     ` Américo Wang
2009-01-21 15:04     ` Chris Mason
2009-01-21 15:04       ` Chris Mason
2009-01-22 16:11       ` Américo Wang
2009-01-22 16:11         ` Américo Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.