Re: [PATCH/RESEND 2/5] mm/z3fold.c: extend compaction function
From: Vitaly Wool
Date: Tue Jan 10 2017 - 15:49:36 EST
On Wed, Jan 4, 2017 at 4:43 PM, Dan Streetman <ddstreet@xxxxxxxx> wrote:
<snip>
>> static int z3fold_compact_page(struct z3fold_header *zhdr)
>> {
>> struct page *page = virt_to_page(zhdr);
>> - void *beg = zhdr;
>> + int ret = 0;
>
> I still don't understand why you're adding ret and using goto. Just
> use return for each failure case.
I guess it's a matter of taste, I prefer having single function exit
elsewhere so I do it here too.
>> +
>> + if (test_bit(MIDDLE_CHUNK_MAPPED, &page->private))
>> + goto out;
>>
>> + if (zhdr->middle_chunks != 0) {
>
> you appear to have just re-sent all your patches without addressing
> comments; in patch 4 you invert the check and return, which is what
> you should have done here in the first place, as that change is
> unrelated to that patch.
Not quite, I just thought we'd agreed on the patch 4 being separate. I
folded the locking fixes but not header size fixes.
~vitaly