cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Abhi Das <adas@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2] gfs2-utils: make gfs2_jadd set GFS2_DIF_SYSTEM flag on system inodes
Date: Fri, 23 Oct 2015 17:21:07 -0500	[thread overview]
Message-ID: <1445638867-30814-2-git-send-email-adas@redhat.com> (raw)
In-Reply-To: <1445638867-30814-1-git-send-email-adas@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



  reply	other threads:[~2015-10-23 22:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2015-10-27 11:18 ` Steven Whitehouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445638867-30814-2-git-send-email-adas@redhat.com \
    --to=adas@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).