From: Theodore Tso <tytso@MIT.EDU>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>,
adilger@sun.com, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] Add extent conversion support to chattr
Date: Tue, 9 Sep 2008 12:47:52 -0400 [thread overview]
Message-ID: <20080909164752.GO21071@mit.edu> (raw)
In-Reply-To: <20080909162814.GB5335@skywalker>
On Tue, Sep 09, 2008 at 09:58:14PM +0530, Aneesh Kumar K.V wrote:
> diff --git a/lib/e2p/fsetflags.c b/lib/e2p/fsetflags.c
> index 62189c9..d1bb9d9 100644
> --- a/lib/e2p/fsetflags.c
> +++ b/lib/e2p/fsetflags.c
> @@ -80,9 +80,19 @@ int fsetflags (const char * name, unsigned long flags)
> if (fd == -1)
> return -1;
> f = (int) flags;
> + if (f & EXT4_EXTENTS_FL) {
> + /* extent flags is set using migrate ioctl */
> + r = ioctl (fd, EXT4_IOC_MIGRATE, NULL);
> + if (r == -1) {
> + save_errno = errno;
> + goto err_out;
> + }
> + f = (int)flags & ~EXT4_EXTENTS_FL;
> + }
No, I wouldn't put this in libe2p; it probably should be in the chattr
program. If you do it in chattr, it's much easier to have an
user-friendly error message if the EXT4_IOC_MIGRATE ioctl fails.
Also, it should only call EXT4_IOC_MIGRATE if the file was previously
not supporting extents. Probably a bad idea to unconditionally call
EXT4_IOC_MIGRATE.
- Ted
next prev parent reply other threads:[~2008-09-09 16:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-09 9:12 [PATCH] Add extent conversion support to chattr Aneesh Kumar K.V
2008-09-09 11:46 ` Christoph Hellwig
2008-09-09 12:36 ` Aneesh Kumar K.V
2008-09-09 13:43 ` Theodore Tso
2008-09-09 14:09 ` Aneesh Kumar K.V
2008-09-09 14:39 ` Theodore Tso
2008-09-09 16:28 ` Aneesh Kumar K.V
2008-09-09 16:47 ` Theodore Tso [this message]
2008-09-09 16:50 ` Christoph Hellwig
2008-09-09 16:54 ` Theodore Tso
-- strict thread matches above, loose matches on Subject: below --
2008-09-12 9:04 Aneesh Kumar K.V
2008-09-12 9:17 ` Andreas Dilger
2008-09-12 9:27 ` Aneesh Kumar K.V
2008-09-12 15:26 ` Andreas Dilger
2008-09-12 9:31 ` Aneesh Kumar K.V
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=20080909164752.GO21071@mit.edu \
--to=tytso@mit.edu \
--cc=adilger@sun.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=hch@infradead.org \
--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 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.