From: Eric Sandeen <sandeen@redhat.com>
To: Kalpak Shah <Kalpak.Shah@Sun.COM>
Cc: Mark Fasheh <mfasheh@suse.com>, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 4/4] ext4: implement ext4_fiemap
Date: Thu, 03 Jul 2008 13:49:48 -0500 [thread overview]
Message-ID: <486D1F4C.6000507@redhat.com> (raw)
In-Reply-To: <1215104513.4272.23.camel@localhost>
Kalpak Shah wrote:
> Extended attributes can be present in the inode as well as the external block at the same time and we should be returning extents for both them in that case. Below patch fixes this problem:
Thanks Kalpak, was on my todo list but not done. :)
-Eric
> Signed-off-by: Kalpak Shah <kalpak.shah@sun.com>
>
> Index: linux-2.6/fs/ext4/extents.c
> ===================================================================
> --- linux-2.6.orig/fs/ext4/extents.c
> +++ linux-2.6/fs/ext4/extents.c
> @@ -3130,7 +3130,7 @@ int ext4_xattr_fiemap(struct inode *inod
> {
> __u64 physical = 0;
> __u64 length;
> - __u32 flags = FIEMAP_EXTENT_LAST;
> + __u32 flags = 0;
> int blockbits = inode->i_sb->s_blocksize_bits;
> int error = 0;
>
> @@ -3148,14 +3148,24 @@ int ext4_xattr_fiemap(struct inode *inod
> physical += offset;
> length = EXT4_SB(inode->i_sb)->s_inode_size - offset;
> flags |= FIEMAP_EXTENT_DATA_INLINE;
> - } else { /* external block */
> - physical = EXT4_I(inode)->i_file_acl << blockbits;
> - length = inode->i_sb->s_blocksize;
> + if (EXT4_I(inode)->i_file_acl == 0)
> + flags |= FIEMAP_EXTENT_LAST;
> +
> + error = fiemap_fill_next_extent(fieinfo, 0, physical, length,
> + flags, inode->i_sb->s_dev);
> + if (error)
> + goto out;
> }
>
> + /* external block */
> + flags = FIEMAP_EXTENT_LAST;
> + physical = EXT4_I(inode)->i_file_acl << blockbits;
> + length = inode->i_sb->s_blocksize;
> if (physical)
> - error = fiemap_fill_next_extent(fieinfo, 0, physical,
> - length, flags, inode->i_sb->s_dev);
> + error = fiemap_fill_next_extent(fieinfo, 0, physical, length,
> + flags, inode->i_sb->s_dev);
> +
> +out:
> return (error < 0 ? error : 0);
> }
>
>
> Thanks,
> Kalpak
>
>
prev parent reply other threads:[~2008-07-03 18:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-25 22:19 [PATCH 4/4] ext4: implement ext4_fiemap Mark Fasheh
2008-07-03 17:01 ` Kalpak Shah
2008-07-03 18:49 ` Eric Sandeen [this message]
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=486D1F4C.6000507@redhat.com \
--to=sandeen@redhat.com \
--cc=Kalpak.Shah@Sun.COM \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mfasheh@suse.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).