2018-01-24 04:16:08

by Tyson Nottingham

[permalink] [raw]
Subject: [PATCH] ext4: make huge file flag user visible.

Make huge file flag visible to clients of FS_IOC_GETFLAGS ioctl, e.g.
the userspace tool lsattr, which expects the flag to be visible.

Signed-off-by: Tyson Nottingham <[email protected]>
---
fs/ext4/ext4.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 3241475..dbd6318 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -400,7 +400,7 @@ struct flex_groups {
#define EXT4_PROJINHERIT_FL 0x20000000 /* Create with parents projid */
#define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */

-#define EXT4_FL_USER_VISIBLE 0x304BDFFF /* User visible flags */
+#define EXT4_FL_USER_VISIBLE 0x304FDFFF /* User visible flags */
#define EXT4_FL_USER_MODIFIABLE 0x204BC0FF /* User modifiable flags */

/* Flags we can manipulate with through EXT4_IOC_FSSETXATTR */
--
2.7.4


2018-01-24 05:03:41

by Darrick J. Wong

[permalink] [raw]
Subject: Re: [PATCH] ext4: make huge file flag user visible.

On Tue, Jan 23, 2018 at 08:15:48PM -0800, Tyson Nottingham wrote:
> Make huge file flag visible to clients of FS_IOC_GETFLAGS ioctl, e.g.
> the userspace tool lsattr, which expects the flag to be visible.

Pardon my asking, but why is this necessary? Are there
userspace-visible effects of this flag?

--D

>
> Signed-off-by: Tyson Nottingham <[email protected]>
> ---
> fs/ext4/ext4.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index 3241475..dbd6318 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -400,7 +400,7 @@ struct flex_groups {
> #define EXT4_PROJINHERIT_FL 0x20000000 /* Create with parents projid */
> #define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */
>
> -#define EXT4_FL_USER_VISIBLE 0x304BDFFF /* User visible flags */
> +#define EXT4_FL_USER_VISIBLE 0x304FDFFF /* User visible flags */
> #define EXT4_FL_USER_MODIFIABLE 0x204BC0FF /* User modifiable flags */
>
> /* Flags we can manipulate with through EXT4_IOC_FSSETXATTR */
> --
> 2.7.4
>

2018-01-24 05:09:37

by Darrick J. Wong

[permalink] [raw]
Subject: Re: [PATCH] ext4: make huge file flag user visible.

On Tue, Jan 23, 2018 at 09:03:33PM -0800, Darrick J. Wong wrote:
> On Tue, Jan 23, 2018 at 08:15:48PM -0800, Tyson Nottingham wrote:
> > Make huge file flag visible to clients of FS_IOC_GETFLAGS ioctl, e.g.
> > the userspace tool lsattr, which expects the flag to be visible.
>
> Pardon my asking, but why is this necessary? Are there
> userspace-visible effects of this flag?

Ahh, the chattr man page says that 'h' means HUGE_FILE_FL, but I guess
ext4 won't report it to userspace...?

<shrug> XFS won't either, maybe we just kill the 'h' option? :)

--D

>
> --D
>
> >
> > Signed-off-by: Tyson Nottingham <[email protected]>
> > ---
> > fs/ext4/ext4.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> > index 3241475..dbd6318 100644
> > --- a/fs/ext4/ext4.h
> > +++ b/fs/ext4/ext4.h
> > @@ -400,7 +400,7 @@ struct flex_groups {
> > #define EXT4_PROJINHERIT_FL 0x20000000 /* Create with parents projid */
> > #define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */
> >
> > -#define EXT4_FL_USER_VISIBLE 0x304BDFFF /* User visible flags */
> > +#define EXT4_FL_USER_VISIBLE 0x304FDFFF /* User visible flags */
> > #define EXT4_FL_USER_MODIFIABLE 0x204BC0FF /* User modifiable flags */
> >
> > /* Flags we can manipulate with through EXT4_IOC_FSSETXATTR */
> > --
> > 2.7.4
> >

2018-01-25 07:48:18

by Tyson Nottingham

[permalink] [raw]
Subject: Re: [PATCH] ext4: make huge file flag user visible.

On Tue, Jan 23, 2018 at 09:09:30PM -0800, Darrick J. Wong wrote:

> > Pardon my asking, but why is this necessary? Are there
> > userspace-visible effects of this flag?
>
> Ahh, the chattr man page says that 'h' means HUGE_FILE_FL, but I guess
> ext4 won't report it to userspace...?
>
> <shrug> XFS won't either, maybe we just kill the 'h' option? :)

Thanks for responses. Yes, I was just trying to make ext4 consistent with the
man page. Since apparently the flag was intended to be user visible at some
point, I thought it would be fine to make it so. As you said, removing it from
chattr/lsattr is another option. I'll do whatever I'm told. :)

Tyson

2018-01-29 23:13:24

by Darrick J. Wong

[permalink] [raw]
Subject: Re: [PATCH] ext4: make huge file flag user visible.

On Wed, Jan 24, 2018 at 11:48:14PM -0800, Tyson Nottingham wrote:
> On Tue, Jan 23, 2018 at 09:09:30PM -0800, Darrick J. Wong wrote:
>
> > > Pardon my asking, but why is this necessary? Are there
> > > userspace-visible effects of this flag?
> >
> > Ahh, the chattr man page says that 'h' means HUGE_FILE_FL, but I guess
> > ext4 won't report it to userspace...?
> >
> > <shrug> XFS won't either, maybe we just kill the 'h' option? :)
>
> Thanks for responses. Yes, I was just trying to make ext4 consistent with the
> man page. Since apparently the flag was intended to be user visible at some
> point, I thought it would be fine to make it so. As you said, removing it from
> chattr/lsattr is another option. I'll do whatever I'm told. :)

Ted hasn't replied in a couple of days, but I would surmise from digging
in the ext4 code that we've never exposed the huge file flag to
userspace, so it'd probably be better to withdraw the documentation/code
of the 'h' option from the chattr manpage instead. ext2/ext3 never had
such a flag at all, so it's unlikely to break anything.

--D

> Tyson

2018-02-05 22:29:51

by Tyson Nottingham

[permalink] [raw]
Subject: Re: [PATCH] ext4: make huge file flag user visible.

On Mon, Jan 29, 2018 at 03:08:16PM -0800, Darrick J. Wong wrote:

> Ted hasn't replied in a couple of days, but I would surmise from digging
> in the ext4 code that we've never exposed the huge file flag to
> userspace, so it'd probably be better to withdraw the documentation/code
> of the 'h' option from the chattr manpage instead. ext2/ext3 never had
> such a flag at all, so it's unlikely to break anything.

I agree. I'll update my existing patch that makes some updates to the chattr
man page.

Thanks,
Tyson