Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2018687lqa; Tue, 30 Apr 2024 06:22:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXXyK/EOIwsASDV/qA/gKghbRS683qTQdmEi4xPms5DFjx3k/9BPrVqLTUrXl8mjCpIz4rYChmcOeqRlrdetWmx4LlQnD7TQWlSjNS/KQ== X-Google-Smtp-Source: AGHT+IFx5g+GqKWm+sRfP/7cLl64dTplhu4RbN8dsnubd3lfvuxXg5WBSrty5Tv2JzRfIq0PmDNg X-Received: by 2002:a05:6a00:130f:b0:6e8:f57d:f1ec with SMTP id j15-20020a056a00130f00b006e8f57df1ecmr16574624pfu.17.1714483328749; Tue, 30 Apr 2024 06:22:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714483328; cv=pass; d=google.com; s=arc-20160816; b=rscnG1wDUmHb0h4pUTqTSokINc0+dGEAjvAHS3Kr/P7yMpyAVLwQ3fJ4M5pWk+HV+c IGubADZsNdkeeLcsW1izKQIyAa0xqRcClibWVdBF+axn2p5b4gRKhzO9e5cGovRxrjQt 7DCUZP16Lk4/b1j9MqUcTM9976mroaYGE4mwgZ0BzFCIFcHUakLrrf8lrMxOo6ec7uU7 Xixzh3+cuS/hcxILIpNBtmmZPRjPegW5xWh1j16q5tJjBu6NmRHHsFQLHgIxc/0jppPA njunkj9Pb/JaaNDzHcegq4YYujm6j7YSSXnfbg7inGhbc/8daT0tNoiYvuNGcKuh7bD+ rA5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=flc38teKNx+GZo7NmJ5kYlP5ydouaYSS4d1wDV2Fd1M=; fh=/9NLhthubZordOGT2OIJSi2bRTJRKPyJWyi8zM3KBio=; b=qHkz0p2+Bq2K3DZVAMsA0sk5+L2eCgIsL4rc/1pApjnRXahCjU1oonvDrFpM9LMKdR OkycOvo65PJAGSm1tuGA46oQtB7LhkH/sS0G3peat8nDpBXdo9P7MQ9qEGt/nlHiT5aG Q8a7Zuni6zNG5AXm7JFP7CYGjDWqCnHHNNWja9aTfOFLxMKpEmMvtm+0w0M6+AZqjspS ejhPIpHE5f5Z5iR+8XRvrvT46zQ86kZ1mHaA8h5W3UA5ehjy9ffTKzcxHgYtyF/K+MUH u9KJiU9Y2WYSAVe6rI7ZRrT9fR8mJrAMsT1aLR4frUkaI+kptmZc0SoKhbm5uVv3qeTP Z7nA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QSyykgKc; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-163980-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163980-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m127-20020a625885000000b006f41a698211si428879pfb.29.2024.04.30.06.22.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 06:22:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163980-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QSyykgKc; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-163980-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163980-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4F571B22824 for ; Tue, 30 Apr 2024 13:19:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD5C4171E4F; Tue, 30 Apr 2024 13:19:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QSyykgKc" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36C3C171668 for ; Tue, 30 Apr 2024 13:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714483176; cv=none; b=OyQTr0rgbKsLpg12Xmiugm35XkdtNmZPqpuZioDLCCLTIG5D1/RNjtT1igu2OhPFACHRKLTRealWVgDqL+79g3DHgY+dNs7/lkPwTiR1H55v5Qc9N9bEpzWq0Bqg6rkq6z3BCqbpmW3JzY+cA7kaD//rfkeRFEYOnw9p2dEUKSk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714483176; c=relaxed/simple; bh=flc38teKNx+GZo7NmJ5kYlP5ydouaYSS4d1wDV2Fd1M=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Jsu29EymGgUhvw9PI7a9lfC0K97xm3xsE2O4xCdWv+TnQFVMc28aiUyroQD0AMo3WYnVkQI22asXOQZA8hFUTm5dus53t/j4KAGVfPC+fxn45HSiK/Ehr94bFQLcKn7pelb1gEnKn5tXsL/mGq9yX7feFJhu0t1Ex+uvuCmRvcc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QSyykgKc; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714483174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=flc38teKNx+GZo7NmJ5kYlP5ydouaYSS4d1wDV2Fd1M=; b=QSyykgKc7Bgy8t5tvngWwlBbbdBY265iy2lXdQiCw7j1NXN41Rey6FcPwssyC/FUF9ZOms XS7yzv1nM181GqtVcW2maxSWoyUfuq/6SrH3a5PI183B3It8nUkp7lIiK4gm26/fKTNbGF sDuAiZa27czZbrTwtYrZ8KPVlQ+ubSY= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-573-qzEtkfj2OjqvElhoCiGK6A-1; Tue, 30 Apr 2024 09:19:32 -0400 X-MC-Unique: qzEtkfj2OjqvElhoCiGK6A-1 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-5728683a63cso244823a12.3 for ; Tue, 30 Apr 2024 06:19:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714483171; x=1715087971; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=flc38teKNx+GZo7NmJ5kYlP5ydouaYSS4d1wDV2Fd1M=; b=PxFVzkMd/GkcBUJBXL6JYyVfGQn4XwDrkfG2uoulTfJbTHnUdncHNSJCdtP8xG3+IB Lpho5+N3FioikMPBOEBZk/eh3Cw8whMIgZA//WywHUMvtBd1HerJRKdTSb3tlApDYWFA 3ijOjjIlVt068E2jwIiDu3y1pQV0pp7V4oOoZ2ur1UrlGGiFLMM/VmOuf9rLpe01yQeq +mQCT9+EWjAeQmIjTfG6KYSs/wDZqFVPKjhN9Z2cNKHAWi/Ut0MXLlanGaHRCuzEfKp3 niRhCBKzz8VvSzXbOXqA8sKpxLdiDdNeVSmG525GNW1XIBn75RviAJX8H4+BeKXkhz10 AIkA== X-Forwarded-Encrypted: i=1; AJvYcCWgWeyKxb2vDkPItGon1UgcU5mcSJxmLwtN/qHfyYi/WcUNeOIIyDbizWuU5a6Ik54Pz4R90G+n5cpsH+8TqZIPWosMfnJiVQogyPrG X-Gm-Message-State: AOJu0YzCDj2bT7s5J8AI5T6KkzGbRC7Vu07NWaqWARRlA13X1ahMDZ9a qwAK2luRVC7C3i/w3vflzuewZi6ZtxyDOeqyE+PjuGYAKWshaucTMkV6jrWK0vCulBhb5quTBzd hvGDXkH7ap4NJ4SDiyKE384yO7rqw4awuLIaQQ0uYJV/66xb3NJJ2XhQsMw3/sQ== X-Received: by 2002:a17:907:31c2:b0:a58:a102:14c9 with SMTP id xf2-20020a17090731c200b00a58a10214c9mr10029941ejb.1.1714483171184; Tue, 30 Apr 2024 06:19:31 -0700 (PDT) X-Received: by 2002:a17:907:31c2:b0:a58:a102:14c9 with SMTP id xf2-20020a17090731c200b00a58a10214c9mr10029918ejb.1.1714483170818; Tue, 30 Apr 2024 06:19:30 -0700 (PDT) Received: from gerbillo.redhat.com ([2a0d:3341:b0ae:6a10::f71]) by smtp.gmail.com with ESMTPSA id j21-20020a170906431500b00a521e5856f6sm15163433ejm.51.2024.04.30.06.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 06:19:30 -0700 (PDT) Message-ID: Subject: Re: [PATCH v2] rxrpc: Fix using alignmask being zero for __page_frag_alloc_align() From: Paolo Abeni To: David Howells Cc: Alexander Duyck , linux-afs@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yunsheng Lin , Marc Dionne , "David S. Miller" , Eric Dumazet , Jakub Kicinski Date: Tue, 30 Apr 2024 15:19:28 +0200 In-Reply-To: <20240428111640.27306-1-linyunsheng@huawei.com> References: <20240428111640.27306-1-linyunsheng@huawei.com> Autocrypt: addr=pabeni@redhat.com; prefer-encrypt=mutual; keydata=mQINBGISiDUBEAC5uMdJicjm3ZlWQJG4u2EU1EhWUSx8IZLUTmEE8zmjPJFSYDcjtfGcbzLPb63BvX7FADmTOkO7gwtDgm501XnQaZgBUnCOUT8qv5MkKsFH20h1XJyqjPeGM55YFAXc+a4WD0YyO5M0+KhDeRLoildeRna1ey944VlZ6Inf67zMYw9vfE5XozBtytFIrRyGEWkQwkjaYhr1cGM8ia24QQVQid3P7SPkR78kJmrT32sGk+TdR4YnZzBvVaojX4AroZrrAQVdOLQWR+w4w1mONfJvahNdjq73tKv51nIpu4SAC1Zmnm3x4u9r22mbMDr0uWqDqwhsvkanYmn4umDKc1ZkBnDIbbumd40x9CKgG6ogVlLYeJa9WyfVMOHDF6f0wRjFjxVoPO6p/ZDkuEa67KCpJnXNYipLJ3MYhdKWBZw0xc3LKiKc+nMfQlo76T/qHMDfRMaMhk+L8gWc3ZlRQFG0/Pd1pdQEiRuvfM5DUXDo/YOZLV0NfRFU9SmtIPhbdm9cV8Hf8mUwubih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zkmSxN1nABoutHEO/N87fpIbpbZaIdinF7b9srwUvDOKsywfs5HMiUZhLKoZzCcU/AEFjQsPTATACGsWf3JYPnWxL9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Sun, 2024-04-28 at 19:16 +0800, Yunsheng Lin wrote: > rxrpc_alloc_data_txbuf() may be called with data_align being > zero in none_alloc_txbuf() and rxkad_alloc_txbuf(), data_align > is supposed to be an order-based alignment value, but zero is > not a valid order-based alignment value, and '~(data_align - 1)' > doesn't result in a valid mask-based alignment value for > __page_frag_alloc_align(). >=20 > Fix it by passing a valid order-based alignment value in > none_alloc_txbuf() and rxkad_alloc_txbuf(). >=20 > Also use page_frag_alloc_align() expecting an order-based > alignment value in rxrpc_alloc_data_txbuf() to avoid doing the > alignment converting operation and to catch possible invalid > alignment value in the future. Remove the 'if (data_align)' > checking too, as it is always true for a valid order-based > alignment value. >=20 > Fixes: 6b2536462fd4 ("rxrpc: Fix use of changed alignment param to page_f= rag_alloc_align()") > Fixes: 49489bb03a50 ("rxrpc: Do zerocopy using MSG_SPLICE_PAGES and page = frags") > CC: David Howells > CC: Alexander Duyck > Signed-off-by: Yunsheng Lin > Acked-by: David Howells Double checking before doing dumb mistakes... @David: I assume from your ack you are fine with this patch being merged via the net tree, am I correct? Thanks, Paolo