From patchwork Mon Oct 13 08:41:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Junling X-Patchwork-Id: 399095 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 45400140092 for ; Mon, 13 Oct 2014 19:54:19 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C9BB8A1C07; Mon, 13 Oct 2014 08:54:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XhnEVnMEVdGl; Mon, 13 Oct 2014 08:54:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 61AF4A1BFA; Mon, 13 Oct 2014 08:54:17 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 07D451BFAA6 for ; Mon, 13 Oct 2014 08:54:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0258D91C80 for ; Mon, 13 Oct 2014 08:54:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wLTTkRERKWot for ; Mon, 13 Oct 2014 08:54:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [119.145.14.64]) by whitealder.osuosl.org (Postfix) with ESMTPS id 87EB391C7B for ; Mon, 13 Oct 2014 08:54:14 +0000 (UTC) Received: from 172.24.2.119 (EHLO szxeml463-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CCU46627; Mon, 13 Oct 2014 16:54:11 +0800 (CST) Received: from Patch-Test.huawei (10.107.197.245) by szxeml463-hub.china.huawei.com (10.82.67.206) with Microsoft SMTP Server id 14.3.158.1; Mon, 13 Oct 2014 16:54:04 +0800 From: Zheng Junling To: Subject: [RFC PATCH] sync_file_range: fix the incorrect args order Date: Mon, 13 Oct 2014 08:41:17 +0000 Message-ID: <1413189677-14018-1-git-send-email-zhengjunling@huawei.com> X-Mailer: git-send-email 1.8.3.4 MIME-Version: 1.0 X-Originating-IP: [10.107.197.245] X-CFilter-Loop: Reflected Cc: wangnan0@huawei.com, peifeiyue@huawei.com X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclibc-bounces@uclibc.org Sender: "uClibc" uClibc handles the sync_file_range2 syscall as well as sync_file_range, passes "flags" as the last argument. However, "flags" should be the second argument in sync_file_range2 syscall. This patch only fixes this bug in arm, not in powerpc and mips yet. And I expect a complete patch. Thanks! ---------------------------------------- Signed-off-by: Zheng Junling --- libc/sysdeps/linux/common/sync_file_range.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libc/sysdeps/linux/common/sync_file_range.c b/libc/sysdeps/linux/common/sync_file_range.c index 8d4ed92..db4f800 100644 --- a/libc/sysdeps/linux/common/sync_file_range.c +++ b/libc/sysdeps/linux/common/sync_file_range.c @@ -28,8 +28,13 @@ static int __NC(sync_file_range)(int fd, off64_t offset, off64_t nbytes, unsigne return INLINE_SYSCALL(sync_file_range, 7, fd, 0, OFF64_HI_LO(offset), OFF64_HI_LO(nbytes), flags); # else +# ifdef __NR_sync_file_range2 + return INLINE_SYSCALL(sync_file_range, 6, fd, flags, + OFF64_HI_LO(offset), OFF64_HI_LO(nbytes)); +# else return INLINE_SYSCALL(sync_file_range, 6, fd, OFF64_HI_LO(offset), OFF64_HI_LO(nbytes), flags); +# endif # endif } CANCELLABLE_SYSCALL(int, sync_file_range, (int fd, off64_t offset, off64_t nbytes, unsigned int flags), (fd, offset, nbytes, flags))