Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp7722172ybc; Thu, 28 Nov 2019 23:53:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzo+tOQf/F3KHZJYUn+rZrDmDPFAfX6/b+exzI8q44W2m2nmnbhjaFkx6vVCz78qvdok4RV X-Received: by 2002:a17:907:40f2:: with SMTP id no2mr59643175ejb.250.1575014020162; Thu, 28 Nov 2019 23:53:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575014020; cv=none; d=google.com; s=arc-20160816; b=nlnAYc3l7ng45r6hogxOWF2R8l1cYuqWfCY7RxtVpMUVSA5HgHnhGMxSpx3lplOBAn EsBd9vr+4zMbQ/TccNyUVic/TcwM/iKZky3mydiNrqrz9KDQ4HGgfQ7scIbboH2VuAXJ 7LURHiBCt0S69z1kPT1c5n4vxqy71PBGetlPajJuBaeeVREZNdX3h4RTzWrMDv8AmQ/l Yr9lrHAKiohvEsDtTWLY9Alo0jLGXNuT2WsCSiHuWmYGp+88yNu9LqWkWERyTkdDzBOf /AlVBA69TeE2/QPc2q/63NxTFfU6WMdS1cRVQerqIZGA/l6Pi1sU2XMBozvVo8ZrS/Cg UFZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature; bh=G7htS148MLHne5gcdg1L2MpYQYz/l/iKEwv8PYFcG2E=; b=OPH4xYsw9dcX6e9qaTWJ7iP/GH7TRTHkSq/dYdmK8GdNwMTHxiLpI7KDgVF73bDKPO TLbqepda3uz1YUf0WpkQnd5aIt048IjgNhIsRZQ6WrnpA87XX+te0ROMsidzjSqHpIJw z6mTZEshG3Z0RPAUbTs7ufkqk7yCfLaLD72a1iXuP8YGEHBP3FRbPDaJj6d0fmvd9+SS V1Ine4v+0fCQFAHJ89W/fi+J3/rjYStOaUNlp1C6MCvSRt9/kPsTfHbawf752fJEOk5x 427INBJiBSBKv14JxWSo6pqPhr2pz2MVV44hKFvEQo9DboFNNSQA/7QlYbc3GnXP935Z mFAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F1sUJA6C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15si13598678ejr.94.2019.11.28.23.53.16; Thu, 28 Nov 2019 23:53:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F1sUJA6C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726920AbfK2HvD (ORCPT + 99 others); Fri, 29 Nov 2019 02:51:03 -0500 Received: from mail-lj1-f180.google.com ([209.85.208.180]:43042 "EHLO mail-lj1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726360AbfK2HvC (ORCPT ); Fri, 29 Nov 2019 02:51:02 -0500 Received: by mail-lj1-f180.google.com with SMTP id a13so7765913ljm.10; Thu, 28 Nov 2019 23:50:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=G7htS148MLHne5gcdg1L2MpYQYz/l/iKEwv8PYFcG2E=; b=F1sUJA6CQo0FU6YJTe8zF3XS9wn1GdYIGYKKW0FkH1WZjpFUNLduWY7619x4knvYuL II29bxpBYNCe1WTppKZPD3gWAjLNZvPN8OYY+bRDbydx8UvRceDBEacyqW7eHUDwYexn TeX/cu4QgfvFSzOQo2tyqLXKl6WzzWLcts+u+DBj+apKQ0DLv2jyN1R6JN4TwG89ZHNM yuCv43rlcM8ImNJ/JymVpNIGiWmBNW8ivSjHfB+WQ3C8K+rDH6OoA1h1H+YcuX6fiPn1 8ODbdSJiZdXp3rJ/vf1zqTG3Tv7a/o7gxl+QC/JTulZCeDkOil1FNdS/SAYXzfr5txH9 wiYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=G7htS148MLHne5gcdg1L2MpYQYz/l/iKEwv8PYFcG2E=; b=WERmLLP1De0aqa6XNds/ch61d1gpqSQQNwVWrJGYNYCWOu1JlPyyJBH91vY1Hwz0rp NMClHvRIS1g6vAi1YgkRQDeQmrQIWV3LY6Pw6kWGJppulS+LBuF8gkstqbG/qBoGu6kU FcyIWpkg/FuTCfTNaPd/EiE8bWpvevtx3WV698FuTXhLtmeDU5+GAfp8kPcxRivTs6w3 U8gkul+4SHcnwVAYsA6QBXZQTkJQqHwmKNXTMZ2Dt3zl1cSbybqSYZFGW+unM+fOsZ6x Ak67SX3VGMD4N6tdCndXDU5xKBu894V648qE05TlyvQSvupjwHFrCY8OUF0h6ueWyMnF ranw== X-Gm-Message-State: APjAAAUSY7cg+zu+RC7eR0R9ZY1yYwn49HTcSGUQrlkwr/ldhyM+FuRB DOMlkrueBErC0sUeEZINRgWYGM6rYBZTIVIMdCc3pujz X-Received: by 2002:a2e:984f:: with SMTP id e15mr36803147ljj.109.1575013858719; Thu, 28 Nov 2019 23:50:58 -0800 (PST) MIME-Version: 1.0 From: Jason Xing Date: Fri, 29 Nov 2019 15:50:22 +0800 Message-ID: Subject: About whether we should support the alignment in the generic_file_splice_read() ? To: viro@zeniv.linux.org.uk Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, Sorry to send this email to you all. I recently noticed there're some incompatibilities existing in the generic_file_splice_read() function between 3.X and 4.X kernel. The result will goes wrong if we're using sendfile() with unaligned offset in 4.X/5.X kernel. But if we do the same in 3.X kernel, it will surely return success. Here is the call trace: 1. Using sendfile() with unaligned offset 2. Then it runs into the kernel: sendfile64()->do_sendfile()->do_splice_direct()->splice_direct_to_actor()->do_splice_to()->splice_read() 3. splice_read() calls the __generic_file_splice_read() in 3.X kernel, generic_file_splice_read() in 4.X kernel. In 3.X kernel, this function handles the alignment by using the PAGE_SHIFT and PAGE_MASK. However, after applying this commit(82c156f853840645604acd7c2cebcb75ed1b6652) the 4.X no longer supports the unaligned data. I'm wondering should we add the alignment process code back again? Does anyone have idea about why this part got removed? Any information and suggestions are welcome:-) Thanks, Jason