linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Jan Kara <jack@suse.cz>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 4/4] tune2fs: Add support for orphan_file feature
Date: Mon, 25 May 2015 09:38:31 +0200	[thread overview]
Message-ID: <20150525073831.GB2387@quack.suse.cz> (raw)
In-Reply-To: <20150522171842.GA830@birch.djwong.org>

On Fri 22-05-15 10:18:42, Darrick J. Wong wrote:
> On Fri, May 22, 2015 at 01:28:57PM +0200, Jan Kara wrote:
> > @@ -1970,6 +2011,31 @@ static int parse_extended_opts(ext2_filsys fs, const char *opts)
> >  				continue;
> >  			}
> >  			ext_mount_opts = strdup(arg);
> > +		} else if (!strcmp(token, "orphan_file_size")) {
> > +			__u64 size;
> > +
> > +			if (!arg) {
> > +				r_usage++;
> > +				continue;
> > +			}
> > +			size = strtoul(arg, &p, 0);
> 
> Would be nice if I could supply units, e.g. orphan_file_size = 128K here.

I don't mind doing this but do we have precedens in any option? Because
e.g. journal size is just a number (in megabytes), stripe options are in fs
blocks. For orphan file megabytes are too coarse. I can make the unit
fs-blocks, or kbytes, or leave it at bytes, or allow specifying units but
some consistency would be good. Any opinion?

> > +			if (*p) {
> > +				fprintf(stderr,
> > +					_("Invalid size of orphan file %s\n"),
> > +					arg);
> > +				r_usage++;
> > +				continue;
> > +			}
> > +			if (size < EXT4_MIN_ORPHAN_FILE_SIZE) {
> > +				fprintf(stderr,
> > +					_("Orphan file is too small. Minimum "
> > +					  "size is %u\n"),
> > +					EXT4_MIN_ORPHAN_FILE_SIZE);
> > +				r_usage++;
> > +				continue;
> > +			}
> > +			orphan_file_blocks = (size + fs->blocksize - 1) /
> > +						fs->blocksize;
> >  		} else
> >  			r_usage++;
> >  	}
> > @@ -2921,6 +2987,17 @@ retry_open:
> >  		if (rc)
> >  			goto closefs;
> >  	}
> > +	if (orphan_file_blocks) {
> 
> If someone specifies -E orphan_file_size=NNN -O ^orphan_file, does this have
> the effect of erasing and recreating the orphan file?

Yes, although that's a side-effect of the option parsing :) Intended use
is that you first disable the orphan_file feature and then enable it again
with new size.

									Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2015-05-25  7:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 11:28 [PATCH 0/4] e2fsprogs: Support for orphan file feature Jan Kara
2015-05-22 11:28 ` [PATCH 1/4] libext2fs: " Jan Kara
2015-05-22 17:35   ` Darrick J. Wong
2015-05-25  7:49     ` Jan Kara
2015-05-22 21:59   ` Andreas Dilger
2015-05-25  8:01     ` Jan Kara
2015-05-22 11:28 ` [PATCH 2/4] mke2fs: Add support for orphan_file feature Jan Kara
2015-05-22 11:28 ` [PATCH 3/4] e2fsck: Add support for handling orphan file Jan Kara
2015-05-22 11:28 ` [PATCH 4/4] tune2fs: Add support for orphan_file feature Jan Kara
2015-05-22 17:18   ` Darrick J. Wong
2015-05-25  7:38     ` Jan Kara [this message]
2015-05-25 16:16       ` Andreas Dilger
2015-05-26  7:24         ` Jan Kara
2015-05-22 15:51 ` [PATCH 0/4] e2fsprogs: Support for orphan file feature Albino Biasutti Neto
2015-05-25  7:19   ` Jan Kara

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=20150525073831.GB2387@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    /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).