Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4784012pxb; Mon, 15 Feb 2021 00:43:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnBYpu9gGHniVj4rjD/jRZsi+eMdX0um7KVvAOu7puNFazUjwHYBNRBCLDtlf3aeMhRbX2 X-Received: by 2002:a17:906:4ac8:: with SMTP id u8mr10097698ejt.426.1613378603179; Mon, 15 Feb 2021 00:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613378603; cv=none; d=google.com; s=arc-20160816; b=p980jnNhcAsFLwqLYkxmqVav5LE/dUcpJU0nW9rZJVOuqVrX1yVyvEJn0V39nJHIXa oLTF5sRhJcABOTqoWW6iRwkIIOXGlWKWI5KufHIjBnfx9H6wbEKdXSFMmTNs49noJ3Gn XPYZbZwC9sJzcE4GpFXJHEDLDH3znmLO6Xl9FVedKEDQKOIUgw4vADH8xuf/MVI7XOyq 2gAfDhFANxivTo8yN8YcW8KZnVYpAQBOAyBwFXrZGJDAGeN9UT9QtOgUn7c3ldoX44e6 /5Q5VUoQnCMqowmBsaRLwvEsBwvibpYfwYpaQS1eaz+sQlWhT7tCthi56dkYd2GVhNKs p9gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ZQ348ps0wv2e4InmeINuZX0d9m8CN4q6775IcZAmEBs=; b=1E2+p3Zq1gUUJPTyp92hNDR1TGuPiGzh2/xeqTDL6BOHCxhsGAL7f7mHyrhJmhmKsd archITesr/pRI18fLEFxXWTA/Zbhe8f49nSkVF3It8Kj+hJpinAemWcT5ghQJRZp7AxJ K1vgric9Emz1tygaEavbIJsyzADEV4MUx0vwJnPYpQSgdiTkc/IVK3blxZ/drOSioo7L AmnDu0geEMAInNTq+l1R731rAO37d5eDiBB2r0b4YK6lE9UaUP1g5vdKBuuzjUANGBD3 dailIsCwQcBYhgop7TlIkUgc40ta3avR96iSJXtC+GQ80YMAwtozq71gXttTt+9ebN6l D8qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WwXoLyKA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 26si3366899ejv.296.2021.02.15.00.43.00; Mon, 15 Feb 2021 00:43:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WwXoLyKA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229931AbhBOImL (ORCPT + 99 others); Mon, 15 Feb 2021 03:42:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbhBOImJ (ORCPT ); Mon, 15 Feb 2021 03:42:09 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44434C061756 for ; Mon, 15 Feb 2021 00:41:29 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id g5so6336688ejt.2 for ; Mon, 15 Feb 2021 00:41:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZQ348ps0wv2e4InmeINuZX0d9m8CN4q6775IcZAmEBs=; b=WwXoLyKA7iLvagNbuwuWEIhoH6920JGn9vk+p2/qHasRxhmrfaIzyGnwPCzLv/tgkh rpEBaJfiqElIc/qidrP2eV6nG2ENJZSxcT/uX+8wxKiH+ItNsJ/v7kEI9cCNUBTEn5Z1 9YOY1IVi5j9JS7jhXICw/gTeZZyKXeXyssTMg0Zs5n2QzaGEWtD7rwWZV7IapInYr6yw vXVZyq6zsmPJ3nPeGpnwJ9NEVMosYb4o5wkEBzYgZyDOd4Q034S5DC0+ieztwHs9VDuH roUwq1/8gK2BIgSG/2CsDGYeVSObOclVbn16pXctORSKdgRJ0p+4ZUxXGRbBzho6oRYo EoBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZQ348ps0wv2e4InmeINuZX0d9m8CN4q6775IcZAmEBs=; b=Cxa2n65hTSZ3l2lZXepR4ALCGGUFfk8hiLN9GxpTId6wmJdXMUXmvkgSY9p9B46JFQ fEmPeFjSeyscXQhrXxgql3quLb2H9urIDfAmNqkRJ4S+nqZdFcNBD6BHBj38PqaBftuP qxjF8JnYgznbLBf4Y0FXQtAT7SCtYjS+3fMNcKvUsA1gDDiYjgM3+s1uFXe4iJfOQOPh +fV9E32jrhPksqLExQ1EpBWF6Njc03B62sZ/xy/ba87VjyNNzjLHDLe9jOiSALoi2sjo SredCxUajAORUng0kz6o/Wuf0Skj63idLh06W7RJkAax6VdsM6c007gaBELkpYS2idqI XiBg== X-Gm-Message-State: AOAM532gQKIc+amIzT+attQ6GfGahFV29pK+a1NGh3G8WcywjKcbe2mW CUJsQ0PyLCrLhgBe9dsyl50eEK7yHrjKjbmfJ8nxh+1JhQKG1P/l X-Received: by 2002:a17:906:685a:: with SMTP id a26mr5372182ejs.503.1613378487664; Mon, 15 Feb 2021 00:41:27 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Naresh Kamboju Date: Mon, 15 Feb 2021 14:11:15 +0530 Message-ID: Subject: Re: LTP: madvise08.c:203: TFAIL: No sequence in dump after MADV_DODUMP. To: Al Viro Cc: Arnd Bergmann , open list , Linux-Next Mailing List , LTP List , lkft-triage@lists.linaro.org, chrubis , Jan Stancek , Stephen Rothwell , Arnd Bergmann , "Eric W. Biederman" , Christian Brauner , Kees Cook , Peter Xu , Andrew Morton , Petr Vorel , Richard Palethorpe , Joerg.Vehlow@aox-tech.de Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Al Viro, On Mon, 15 Feb 2021 at 01:25, Al Viro wrote: > > On Mon, Jan 25, 2021 at 10:01:48PM +0530, Naresh Kamboju wrote: > > commit 8a3cc755b13808eba74846dfd1033fcbc21f9a65 > > Author: Al Viro > > Date: Sun Mar 8 09:16:37 2020 -0400 > > > > coredump: don't bother with do_truncate() > > > > have dump_skip() just remember how much needs to be skipped, > > leave actual seeks/writing zeroes to the next dump_emit() > > or the end of coredump output, whichever comes first. > > And instead of playing with do_truncate() in the end, just > > write one NUL at the end of the last gap (if any). > > > > Signed-off-by: Al Viro > > > > fs/binfmt_elf.c | 1 - > > fs/coredump.c | 56 +++++++++++++++++++++++++++--------------------- > > include/linux/binfmts.h | 1 + > > include/linux/coredump.h | 1 - > > > > > > Test case output link, > > https://lkft.validation.linaro.org/scheduler/job/2184975#L1369 > > https://lkft.validation.linaro.org/scheduler/job/2184972#L1358 > > I think I see what's going on. Could you check if the following > fixes your reproducer? > > diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c > index 60b5583e9eaf..1a587618015c 100644 > --- a/arch/powerpc/platforms/cell/spufs/coredump.c > +++ b/arch/powerpc/platforms/cell/spufs/coredump.c > @@ -149,8 +149,7 @@ static int spufs_arch_write_note(struct spu_context *ctx, int i, > return -EIO; > } > > - if (!dump_skip(cprm, roundup(cprm->pos - ret + sz, 4) - cprm->pos)) > - return -EIO; > + dump_skip_to(cprm, roundup(cprm->pos - ret + sz, 4)); > return 0; > } > > diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c > index 66137d5dca5f..474a3c7dd5ce 100644 > --- a/fs/binfmt_elf.c > +++ b/fs/binfmt_elf.c > @@ -2267,8 +2267,7 @@ static int elf_core_dump(struct coredump_params *cprm) > goto end_coredump; > > /* Align to page */ > - if (!dump_skip(cprm, dataoff - cprm->pos)) > - goto end_coredump; > + dump_skip_to(cprm, dataoff); > > for (i = 0; i < vma_count; i++) { > struct core_vma_metadata *meta = vma_meta + i; > diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c > index be4062b8ba75..01f043971644 100644 > --- a/fs/binfmt_elf_fdpic.c > +++ b/fs/binfmt_elf_fdpic.c > @@ -1640,8 +1640,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) > goto end_coredump; > } > > - if (!dump_skip(cprm, dataoff - cprm->pos)) > - goto end_coredump; > + dump_skip_to(cprm, dataoff); > > if (!elf_fdpic_dump_segments(cprm, vma_meta, vma_count)) > goto end_coredump; > diff --git a/fs/coredump.c b/fs/coredump.c > index 27a93f724251..bfac7422cd14 100644 > --- a/fs/coredump.c > +++ b/fs/coredump.c > @@ -894,7 +894,14 @@ int dump_emit(struct coredump_params *cprm, const void *addr, int nr) > } > EXPORT_SYMBOL(dump_emit); > > -int dump_skip(struct coredump_params *cprm, size_t nr) > +void dump_skip_to(struct coredump_params *cprm, unsigned long pos) > +{ > + cprm->to_skip = pos - cprm->pos; > + return 0; fs/coredump.c:903:9: error: 'return' with a value, in function returning void [-Werror=return-type] 903 | return 0; | ^ Build failed due to above error. build log link, https://gitlab.com/Linaro/lkft/users/naresh.kamboju/linux/-/jobs/1029838856#L383 - Naresh