From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Mason Subject: Re: [PATCH] fix __swap_writepage() compile failure on old gcc versions Date: Mon, 16 Jun 2014 13:55:26 -0400 Message-ID: <539F2F8E.5050601@fb.com> References: <201406132103.HCI73982.HFOOMFFSLVtJQO@I-love.SAKURA.ne.jp> <20140613144843.GH18016@ZenIV.linux.org.uk> <20140614061241.GJ18016@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Cc: , Tetsuo Handa To: Al Viro , Linus Torvalds Return-path: Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:35441 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932197AbaFPRuT (ORCPT ); Mon, 16 Jun 2014 13:50:19 -0400 In-Reply-To: <20140614061241.GJ18016@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 06/14/2014 02:12 AM, Al Viro wrote: > On Fri, Jun 13, 2014 at 03:48:43PM +0100, Al Viro wrote: >> On Fri, Jun 13, 2014 at 09:03:36PM +0900, Tetsuo Handa wrote: >>> >From 75b9f78ddc8ab30555a520f5a2477a9340341dd1 Mon Sep 17 00:00:00 2001 >>> From: Tetsuo Handa >>> Date: Fri, 13 Jun 2014 12:35:35 +0900 >>> Subject: [PATCH pre 3.16-rc1] bio: Fix build failure. >>> >>> Commit 62a8067a7f "bio_vec-backed iov_iter" introduced an unnamed union >>> inside a struct which gcc-4.4.7 cannot handle. Name the unnamed union as >>> u in order to fix build failure. >> >> Sigh... Oh, well - it will be a while until we can use them (anon union >> and struct members are valid C11; it's not just gccism). Applied, will >> push to Linus today if he hasn't picked that one up himself. > > Let's do this instead: there is only one place in the entire tree that > steps into this breakage. Anon structs and unions work in older gcc > versions; as the matter of fact, we have those in the tree - see e.g. > struct ieee80211_tx_info in include/net/mac80211.h > > What doesn't work is handling their initializers: [ ... ] > --- > diff --git a/mm/page_io.c b/mm/page_io.c > index 33bb38c..fe24f78 100644 > --- a/mm/page_io.c > +++ b/mm/page_io.c > @@ -269,8 +269,8 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, > .count = PAGE_SIZE, > .iov_offset = 0, > .nr_segs = 1, > - .bvec = &bv > }; > + from.bvec = &bv; /* older gcc versions are broken */ This was how I tested before my last pull request, it was enough to compile on gcc 4.4.6. -chris