[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHc6FU59B+s9rktG8PmDJvqnag-hQMcwJC57N-ZVFF2JwjAAPg@mail.gmail.com>
Date: Tue, 25 Jul 2017 14:19:01 +0200
From: Andreas Gruenbacher <agruenba@...hat.com>
To: Jan Kara <jack@...e.cz>
Cc: Christoph Hellwig <hch@....de>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-xfs@...r.kernel.org, linux-ext4 <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH v4 3/3] ext4: Add IOMAP_REPORT support for inline data
On Tue, Jul 25, 2017 at 2:16 PM, Jan Kara <jack@...e.cz> wrote:
> On Fri 07-07-17 23:28:01, Andreas Gruenbacher wrote:
>> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
>> index 82f3f7d..e2b0a8a 100644
>> --- a/fs/ext4/inode.c
>> +++ b/fs/ext4/inode.c
>> @@ -3361,8 +3361,13 @@ static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
>> bool delalloc = false;
>> int ret;
>>
>> - if (WARN_ON_ONCE(ext4_has_inline_data(inode)))
>> - return -ERANGE;
>> + if (ext4_has_inline_data(inode)) {
>> + if (WARN_ON_ONCE(!(flags & IOMAP_REPORT)))
>> + return -ERANGE;
>> + if (!ext4_inline_data_iomap(inode, iomap) &&
>> + offset < iomap->length)
>
> Hum, what's the thinking behind this "offset < iomap->length" check? If it
> fails, we'd just fall through to the normal case which I'm not sure is
> guaranteed to be safe? Shouldn't we return error instead?
Indeed. I'll send out an updated patch queue including this and
several other changes shortly.
Thanks,
Andreas
Powered by blists - more mailing lists