[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ECDB778.30006@redhat.com>
Date: Thu, 24 Nov 2011 11:18:16 +0800
From: Cong Wang <amwang@...hat.com>
To: Hugh Dickins <hughd@...gle.com>
CC: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
Pekka Enberg <penberg@...nel.org>,
Christoph Hellwig <hch@....de>,
Dave Hansen <dave@...ux.vnet.ibm.com>,
Lennart Poettering <lennart@...ttering.net>,
Kay Sievers <kay.sievers@...y.org>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
linux-mm@...ck.org
Subject: Re: [V3 PATCH 1/2] tmpfs: add fallocate support
于 2011年11月24日 03:07, Hugh Dickins 写道:
> On Wed, 23 Nov 2011, Cong Wang wrote:
>> +
>> + while (index< end) {
>> + ret = shmem_getpage(inode, index,&page, SGP_WRITE, NULL);
>> + if (ret) {
>> + if (ret == -ENOSPC)
>> + goto undo;
> ...
>> +undo:
>> + while (index> start) {
>> + shmem_truncate_page(inode, index);
>> + index--;
>> + }
>
> As I said before, I won't actually be reviewing and testing this for
> a week or two; but before this goes any further, must point out how
> wrong it is. Here you'll be deleting any pages in the range that were
> already present before the failing fallocate().
Ah, I totally missed this. So, is there any way to tell if the page
gotten from shmem_getpage() is newly allocated or not?
I will dig the code...
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists