* [Ocfs2-devel] Add --force option in tunefs
@ 2008-07-02 9:48 Goldwyn Rodrigues
2008-07-02 19:44 ` Joel Becker
0 siblings, 1 reply; 3+ messages in thread
From: Goldwyn Rodrigues @ 2008-07-02 9:48 UTC (permalink / raw)
To: ocfs2-devel
This patch enable --force option in tunefs.ocfs2
Like mkfs, the --force option ignores cluster initialization
and locking.
A force option is useless for local mounts and hence, to display the
warning message, the check for force flag is checked after the check for
local mount.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.de>
diff --git a/tunefs.ocfs2/tunefs.c b/tunefs.ocfs2/tunefs.c
index be10eb2..e238f1e 100644
--- a/tunefs.ocfs2/tunefs.c
+++ b/tunefs.ocfs2/tunefs.c
@@ -44,7 +44,7 @@ static void usage(const char *progname)
fprintf(stderr, "usage: %s [-J journal-options] [-L volume-label]\n"
"\t\t[-M mount-type] [-N number-of-node-slots] [-Q query-fmt]\n"
"\t\t[--update-cluster-stack]\n"
- "\t\t[-qSUvV] [--backup-super] [--list-sparse]\n"
+ "\t\t[-qSUvV] [--backup-super] [--list-sparse] [--force]\n"
"\t\t[--fs-features=[no]sparse,...]] device [blocks-count]\n",
progname);
exit(0);
@@ -202,6 +202,7 @@ static void get_options(int argc, char **argv)
{ "quiet", 0, 0, 'q' },
{ "query", 1, 0, 'Q' },
{ "version", 0, 0, 'V' },
+ { "force", 0, 0, 'F' },
{ "journal-options", 0, 0, 'J'},
{ "volume-size", 0, 0, 'S'},
{ "uuid-reset", 0, 0, 'U'},
@@ -221,7 +222,7 @@ static void get_options(int argc, char **argv)
opts.prompt = 1;
while (1) {
- c = getopt_long(argc, argv, "L:N:J:M:Q:SUvqVxb", long_options,
+ c = getopt_long(argc, argv, "L:N:J:M:Q:SUvqVFxb", long_options,
NULL);
if (c == -1)
@@ -292,6 +293,10 @@ static void get_options(int argc, char **argv)
opts.verbose = 1;
break;
+ case 'F':
+ opts.force = 1;
+ break;
+
case 'q':
opts.quiet = 1;
break;
@@ -1295,6 +1300,10 @@ int main(int argc, char **argv)
get_vol_size(fs);
if (!ocfs2_mount_local(fs)) {
+ if (opts.force) {
+ fprintf(stderr, "WARNING: Cluster check disabled.\n");
+ goto skip_cluster_start;
+ }
ret = o2cb_init();
if (ret) {
com_err(opts.progname, ret, "while initializing the cluster");
diff --git a/tunefs.ocfs2/tunefs.h b/tunefs.ocfs2/tunefs.h
index c7b4acf..819997b 100644
--- a/tunefs.ocfs2/tunefs.h
+++ b/tunefs.ocfs2/tunefs.h
@@ -87,6 +87,7 @@ typedef struct _ocfs2_tune_opts {
int verbose;
int quiet;
int prompt;
+ int force;
int backup_super;
int update_cluster;
int list_sparse;
--
Goldwyn
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Ocfs2-devel] Add --force option in tunefs
2008-07-02 9:48 [Ocfs2-devel] Add --force option in tunefs Goldwyn Rodrigues
@ 2008-07-02 19:44 ` Joel Becker
2008-07-03 0:49 ` Sunil Mushran
0 siblings, 1 reply; 3+ messages in thread
From: Joel Becker @ 2008-07-02 19:44 UTC (permalink / raw)
To: ocfs2-devel
On Wed, Jul 02, 2008 at 03:18:04PM +0530, Goldwyn Rodrigues wrote:
Hey, there. Tools changes belong on
ocfs2-tools-devel at oss.oracle.com, so I've copied that mailing list.
> This patch enable --force option in tunefs.ocfs2
> Like mkfs, the --force option ignores cluster initialization
> and locking.
Thanks for the patch, but we decided long ago that we didn't
want tunefs run without the cluster. That's why there is no force
option. It's intentional.
Joel
--
"Born under a bad sign.
I been down since I began to crawl.
If it wasn't for bad luck,
I wouldn't have no luck at all."
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Ocfs2-devel] Add --force option in tunefs
2008-07-02 19:44 ` Joel Becker
@ 2008-07-03 0:49 ` Sunil Mushran
0 siblings, 0 replies; 3+ messages in thread
From: Sunil Mushran @ 2008-07-03 0:49 UTC (permalink / raw)
To: ocfs2-devel
Well, we need to have a --force override if only to allow users
cloning ocfs2 volumes an easy way to change the uuid.
Goldwyn,
What is your justification for needing this feature? As in,
allowing force override to change mount type from clustered to local.
Is this a specific user requirement?
Our fear is that this override will allow some script author to
hard code it leading to corruption. As in, click here to change the
mount type. I mean, we already have a force override in mkfs, but
format is something users understand wipes the data. I am not sure
users will immediately understand that changing the mount type will
corrupt the fs if it is mounted on another node.
Sunil
Joel Becker wrote:
> On Wed, Jul 02, 2008 at 03:18:04PM +0530, Goldwyn Rodrigues wrote:
>
> Hey, there. Tools changes belong on
> ocfs2-tools-devel at oss.oracle.com, so I've copied that mailing list.
>
>
>> This patch enable --force option in tunefs.ocfs2
>> Like mkfs, the --force option ignores cluster initialization
>> and locking.
>>
>
> Thanks for the patch, but we decided long ago that we didn't
> want tunefs run without the cluster. That's why there is no force
> option. It's intentional.
>
> Joel
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-03 0:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-02 9:48 [Ocfs2-devel] Add --force option in tunefs Goldwyn Rodrigues
2008-07-02 19:44 ` Joel Becker
2008-07-03 0:49 ` Sunil Mushran
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.