cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2 PATCH] gfs2: allow userspace to set GFS2_DIF_SYSTEM using FS_RESERVED_FL
@ 2015-10-23 22:21 Abhi Das
  2015-10-23 22:21 ` [Cluster-devel] [GFS2] gfs2-utils: make gfs2_jadd set GFS2_DIF_SYSTEM flag on system inodes Abhi Das
  2015-10-27 11:18 ` [Cluster-devel] [GFS2 PATCH] gfs2: allow userspace to set GFS2_DIF_SYSTEM using FS_RESERVED_FL Steven Whitehouse
  0 siblings, 2 replies; 3+ messages in thread
From: Abhi Das @ 2015-10-23 22:21 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Repurpose the existing VFS FS_RESERVED_FL flag to set GFS2_DIF_SYSTEM
using the FS_IOC_SETFLAGS ioctl.

Resolves: rhbz#1272086
Signed-off-by: Abhi Das <adas@redhat.com>
---
 fs/gfs2/file.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 71cd138..ead0d0a 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -137,6 +137,7 @@ static const u32 fsflags_to_gfs2[32] = {
 	[12] = GFS2_DIF_EXHASH,
 	[14] = GFS2_DIF_INHERIT_JDATA,
 	[17] = GFS2_DIF_TOPDIR,
+	[31] = GFS2_DIF_SYSTEM,
 };
 
 static const u32 gfs2_to_fsflags[32] = {
@@ -147,6 +148,7 @@ static const u32 gfs2_to_fsflags[32] = {
 	[gfs2fl_ExHash] = FS_INDEX_FL,
 	[gfs2fl_TopLevel] = FS_TOPDIR_FL,
 	[gfs2fl_InheritJdata] = FS_JOURNAL_DATA_FL,
+	[gfs2fl_System] = FS_RESERVED_FL,
 };
 
 static int gfs2_get_flags(struct file *filp, u32 __user *ptr)
-- 
2.4.3



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

* [Cluster-devel] [GFS2] gfs2-utils: make gfs2_jadd set GFS2_DIF_SYSTEM flag on system inodes
  2015-10-23 22:21 [Cluster-devel] [GFS2 PATCH] gfs2: allow userspace to set GFS2_DIF_SYSTEM using FS_RESERVED_FL Abhi Das
@ 2015-10-23 22:21 ` Abhi Das
  2015-10-27 11:18 ` [Cluster-devel] [GFS2 PATCH] gfs2: allow userspace to set GFS2_DIF_SYSTEM using FS_RESERVED_FL Steven Whitehouse
  1 sibling, 0 replies; 3+ messages in thread
From: Abhi Das @ 2015-10-23 22:21 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Reuse the VFS FS_RESERVED_FL to set the GFS2_DIF_SYSTEM flag on gfs2
metafs inodes (journals and such) created by gfs2_jadd.

A companion kernel patch that actually does the mapping from the VFS
flag to GFS2 is required in order for this to work correctly.

Resolves: rhbz#1272086
Signed-off-by: Abhi Das <adas@redhat.com>
---
 gfs2/mkfs/main_jadd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index de5d9c5..538d820 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -274,7 +274,7 @@ static void add_ir(struct jadd_opts *opts)
 	{
 		struct gfs2_inum_range ir;
 
-		set_flags(fd, JA_FL_SET, FS_JOURNAL_DATA_FL);
+		set_flags(fd, JA_FL_SET, FS_JOURNAL_DATA_FL|FS_RESERVED_FL);
 		memset(&ir, 0, sizeof(struct gfs2_inum_range));
 		if (write(fd, (void*)&ir, sizeof(struct gfs2_inum_range)) !=
 		    sizeof(struct gfs2_inum_range)) {
@@ -303,7 +303,7 @@ static void add_sc(struct jadd_opts *opts)
 
 	{
 		struct gfs2_statfs_change sc;
-		set_flags(fd, JA_FL_SET, FS_JOURNAL_DATA_FL);
+		set_flags(fd, JA_FL_SET, FS_JOURNAL_DATA_FL|FS_RESERVED_FL);
 
 		memset(&sc, 0, sizeof(struct gfs2_statfs_change));
 		if (write(fd, (void*)&sc, sizeof(struct gfs2_statfs_change)) !=
@@ -341,6 +341,7 @@ static void add_qc(struct gfs2_sbd *sdp, struct jadd_opts *opts)
 
 		dummy_bh.b_data = buf;
 		set_flags(fd, JA_FL_CLEAR, FS_JOURNAL_DATA_FL);
+		set_flags(fd, JA_FL_SET, FS_RESERVED_FL);
 		memset(buf, 0, sdp->bsize);
 
 		for (x=0; x<blocks; x++) {
@@ -436,6 +437,7 @@ static void add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts)
 		uint64_t seq = RANDOM(blocks);
 
 		set_flags(fd, JA_FL_CLEAR, FS_JOURNAL_DATA_FL);
+		set_flags(fd, JA_FL_SET, FS_RESERVED_FL);
 		memset(buf, 0, sdp->bsize);
 		for (x=0; x<blocks; x++) {
 			if (write(fd, buf, sdp->bsize) != sdp->bsize) {
-- 
2.4.3



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

* [Cluster-devel] [GFS2 PATCH] gfs2: allow userspace to set GFS2_DIF_SYSTEM using FS_RESERVED_FL
  2015-10-23 22:21 [Cluster-devel] [GFS2 PATCH] gfs2: allow userspace to set GFS2_DIF_SYSTEM using FS_RESERVED_FL Abhi Das
  2015-10-23 22:21 ` [Cluster-devel] [GFS2] gfs2-utils: make gfs2_jadd set GFS2_DIF_SYSTEM flag on system inodes Abhi Das
@ 2015-10-27 11:18 ` Steven Whitehouse
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Whitehouse @ 2015-10-27 11:18 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

I'm not sure that is a good idea, since it is possible that someone else 
might find a use for that flag. Can we not simply set the 
GFS2_DIF_SYSTEM flag on any inode that is created via the metafs? That 
would resolve the issue without having to have a new interface I think,

Steve.

On 23/10/15 23:21, Abhi Das wrote:
> Repurpose the existing VFS FS_RESERVED_FL flag to set GFS2_DIF_SYSTEM
> using the FS_IOC_SETFLAGS ioctl.
>
> Resolves: rhbz#1272086
> Signed-off-by: Abhi Das <adas@redhat.com>
> ---
>   fs/gfs2/file.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
> index 71cd138..ead0d0a 100644
> --- a/fs/gfs2/file.c
> +++ b/fs/gfs2/file.c
> @@ -137,6 +137,7 @@ static const u32 fsflags_to_gfs2[32] = {
>   	[12] = GFS2_DIF_EXHASH,
>   	[14] = GFS2_DIF_INHERIT_JDATA,
>   	[17] = GFS2_DIF_TOPDIR,
> +	[31] = GFS2_DIF_SYSTEM,
>   };
>   
>   static const u32 gfs2_to_fsflags[32] = {
> @@ -147,6 +148,7 @@ static const u32 gfs2_to_fsflags[32] = {
>   	[gfs2fl_ExHash] = FS_INDEX_FL,
>   	[gfs2fl_TopLevel] = FS_TOPDIR_FL,
>   	[gfs2fl_InheritJdata] = FS_JOURNAL_DATA_FL,
> +	[gfs2fl_System] = FS_RESERVED_FL,
>   };
>   
>   static int gfs2_get_flags(struct file *filp, u32 __user *ptr)



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

end of thread, other threads:[~2015-10-27 11:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-23 22:21 [Cluster-devel] [GFS2 PATCH] gfs2: allow userspace to set GFS2_DIF_SYSTEM using FS_RESERVED_FL Abhi Das
2015-10-23 22:21 ` [Cluster-devel] [GFS2] gfs2-utils: make gfs2_jadd set GFS2_DIF_SYSTEM flag on system inodes Abhi Das
2015-10-27 11:18 ` [Cluster-devel] [GFS2 PATCH] gfs2: allow userspace to set GFS2_DIF_SYSTEM using FS_RESERVED_FL Steven Whitehouse

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