From patchwork Mon Sep 18 12:32:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 141521 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2886888vqi; Mon, 18 Sep 2023 12:04:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGyctgWuETfPVEV0hAfyQ/T/vQvTLtEBrEVriGD3nJtOi9BGwLqgdljuhG0uqq3Nj2qI6gt X-Received: by 2002:a05:6a20:4304:b0:121:ca90:df01 with SMTP id h4-20020a056a20430400b00121ca90df01mr9694193pzk.40.1695063881005; Mon, 18 Sep 2023 12:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695063880; cv=none; d=google.com; s=arc-20160816; b=M7sz6gkHwqhCF4zRrq7amvHx15BIOae5Rs8OdNSQOHmxguh4QEDnBZfgMFEFhqO2vd /vvPfEB+WYQm48J0jc60AeN7ta7iODrcMf+Dq6CLVUbiy575j63+OEIXzVrmy+8lq5vZ evsb8CCT55brtzaZYqKsSYhZIMk1DWLA1+MPtMxoc3CN25Y8GykJhBT8EAjZdfnrQgoP 3AggGXBGeE2u2H7Z49aNhjp4Oh4lY+x18jlpC1wZGqts1N67+KSG8I1siL1jvLlslKRu l2RUcOgsIRCdFLMoWbhCwUlxlzC63ikMMHMNBC9emINFOa3dJrzwDWHMsFarxuaEJz/U JpWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=bTIpQ2wCkQ3gsn9IN2OtZFBrX++kayidfIH0DbMWLuA=; fh=wd7qOuYAeNqOqTJ3FnCoYa4/XxYdErzLkNb6cLbRrzw=; b=NfDY969pSzNKnQ6lHwfkl7qgx6xKjTz4wGtKPwRVzwfKyByBugagzPzppEQYK5g85n WA484bw5ekm3Fo/bchP9DSSNz+5DjuuqcwuHX09OUAwEDJ9bhK8R4MimKz26+OmVfva1 klypYFjEP9WrLhAi4HJMtX8bg+8GbVFNKv7oR8EhHMifefZsY9FSO2WAjFJ+ZmUuw+pQ MdUFTRD6XMs3w0fQe1/z2LGChBcNPZZPLAXjyjK1z+PeNPYCt7ky+3gsfmd4RlHV4H53 UMjCsINViafYmaX1l26VidoLs5IbTVGMyQLwmN09gYrulkgwrm/aqs7viYi5CKPGWPVG Pxuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=fJJU9BqT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id cn9-20020a056a00340900b0068fcccf5c79si8486264pfb.220.2023.09.18.12.04.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 12:04:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=fJJU9BqT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 029D381C4AA6; Mon, 18 Sep 2023 05:33:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241167AbjIRMdV (ORCPT + 27 others); Mon, 18 Sep 2023 08:33:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241216AbjIRMcu (ORCPT ); Mon, 18 Sep 2023 08:32:50 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5357311C for ; Mon, 18 Sep 2023 05:32:31 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-9ad8a33fd0dso564658266b.3 for ; Mon, 18 Sep 2023 05:32:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1695040350; x=1695645150; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bTIpQ2wCkQ3gsn9IN2OtZFBrX++kayidfIH0DbMWLuA=; b=fJJU9BqTIihg7qWtYW0OAU0Reg/jv7ksGHuJmnrEXD2jsFE2+cews4dZFPDxn+80iS 8b7uHs/e/18DlFnNn63JImv9m9pgPze8a8p3T8Yx28CJgbdPHPMlPP/P3U3bjDtGhSCY OHrDqqfJUa+SKehcgYVlwpjV/hqSdls4G1LpcQv8XWisfr8lUg4CQMimVybhcycoRoxw owEiJZoEEA7nZGQnt6KXjK5fk5nd9YRe9VyWt5VGdKECs6J3y1WMVfiQD5rJyEdK/uZN B70h4cUIOzjqR2jkBxNpM5uC5Hz6BToCy4F4VvqS/tCjiidpQRy8mCGaWqADn52r10Zl JGUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695040350; x=1695645150; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bTIpQ2wCkQ3gsn9IN2OtZFBrX++kayidfIH0DbMWLuA=; b=j3umV96HLx8Ol74T32jF/NnL+b/GU23MJRsRBHvVJzcljpcWRyBAG/KE+yaOAsmAzJ JY03vonmOHAeiapZGZKwLKt6qSw88XSoSAd/WnZtDtOazjYg6TkecgXB5dQrOsGb+5yT YKAW9sQTf0Fc0S5azY1e8TaoBcsgmjStewX4uyyJnuCGGs8nWvfYuL5sM4nbu/SQdXwb 7aRZOX53yi31m5cVdfqoCHWQnTjk8Ec3Eb4Tpy0a7gW1vJgr3xa+h8rEg5hoqVohrZlS joLWMM6ZpVj+uaqnYexcmcrGGJBqR+vDc9WUClP3otwJ84QG8i9zm+cG6E6LcOIc2GAR CPtQ== X-Gm-Message-State: AOJu0YwHduDhKm+gxj6iK5i/LFM/XX+04Ul9D4zeYlCP0fHijsNel8Wt ija7CKiYt/cioCBljuBuu1l4tw== X-Received: by 2002:a17:907:7888:b0:9ad:e244:911e with SMTP id ku8-20020a170907788800b009ade244911emr6635009ejc.55.1695040349768; Mon, 18 Sep 2023 05:32:29 -0700 (PDT) Received: from heron.intern.cm-ag (p200300dc6f209c00529a4cfffe3dd983.dip0.t-ipconnect.de. [2003:dc:6f20:9c00:529a:4cff:fe3d:d983]) by smtp.gmail.com with ESMTPSA id sd5-20020a170906ce2500b00992a8a54f32sm6328834ejb.139.2023.09.18.05.32.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 05:32:29 -0700 (PDT) From: Max Kellermann To: jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: amir73il@gmail.com, max.kellermann@ionos.com Subject: [PATCH 1/4] inotify_user: pass directory fd to inotify_find_inode() Date: Mon, 18 Sep 2023 14:32:14 +0200 Message-Id: <20230918123217.932179-1-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 18 Sep 2023 05:33:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777403304164054443 X-GMAIL-MSGID: 1777403304164054443 Preparing for inotify_add_watch_at(). To: Jan Kara Cc: Amir Goldstein To: linux-fsdevel@vger.kernel.org To: linux-kernel@vger.kernel.org Signed-off-by: Max Kellermann --- fs/notify/inotify/inotify_user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 1c4bfdab008d..1853439a24f6 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c @@ -370,12 +370,12 @@ static const struct file_operations inotify_fops = { /* * find_inode - resolve a user-given path to a specific inode */ -static int inotify_find_inode(const char __user *dirname, struct path *path, +static int inotify_find_inode(int dfd, const char __user *dirname, struct path *path, unsigned int flags, __u64 mask) { int error; - error = user_path_at(AT_FDCWD, dirname, flags, path); + error = user_path_at(dfd, dirname, flags, path); if (error) return error; /* you can only watch an inode if you have read permissions on it */ @@ -774,7 +774,7 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, if (mask & IN_ONLYDIR) flags |= LOOKUP_DIRECTORY; - ret = inotify_find_inode(pathname, &path, flags, + ret = inotify_find_inode(AT_FDCWD, pathname, &path, flags, (mask & IN_ALL_EVENTS)); if (ret) goto fput_and_out; From patchwork Mon Sep 18 12:32:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 141441 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2723133vqi; Mon, 18 Sep 2023 08:00:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2ZNwfnkJAKrndSyPIapoaK0N6uXoxDvmNf1sArDoEBFGBNIUBZsVWacNTwbwFLzs2ESHm X-Received: by 2002:a05:6a00:1306:b0:68e:4834:4b25 with SMTP id j6-20020a056a00130600b0068e48344b25mr11480811pfu.13.1695049250395; Mon, 18 Sep 2023 08:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695049250; cv=none; d=google.com; s=arc-20160816; b=sf93UtHWpY4dPrjWfsrBU6MxnzooaeVYwQuFd10b/3rVCL1Ez4jiSrVH6G0RtukaOM Grpf62TRGkSxBKaZtO27z5FjDXGBviXeykS9a8vb+FT8xyWABfVgSkzWNpB1VYLFbwWV ovZBw9AJ5DOotilCFgp1sVv5/vYAMLyK5MAb0TvOOumzJiLSdh5lQ9P5OXvwwKzYtDjy w6uTONcliQyKGld11/NJipBF/d8dRzcajI0lkP6h789V+ts/mSjbWx0EFfXu2PJpGb5E rJHqhQ60HvlToEDJrhfIbWuVK2s2BBzYhkMSpaWPnGK9mlPjoVW+EPoNe6pbsIeMpqW2 Qsww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uqgSIBXgk25i53ApRC28zb/oSMjI8zuN4nMgi5m6KPw=; fh=wd7qOuYAeNqOqTJ3FnCoYa4/XxYdErzLkNb6cLbRrzw=; b=CoqJ18bnfxC7Zmhvxx5ZnwFI9lc907Y9wOf0JXIsbGyxMRJeqJCyO2knguX42IhsHa 6FxlWn01cJWTNsN576tnuAGTWGsm5fVw5HFwWWefdsAtblMyQZ6oYDRgJm6K3WehDnXC mtR1k77DO6fdtiSSD8yRDAg4ffWVSrG7XldrQkzM6Fiq/cEY1Ckr2yX5j7WBz5MUEOCm 5u790BC78rqPc1Y/A1iCLMMZzPPFm3o2+KOKVJQ07CZLDyQ+56VmEFyLaQTLu8TXDqYL L7J+LPJysa6WRYk2MRxhLvwGtUTo+Y+Gz/W50D3kQ/bdM13vb2LOyqPs/pZEQdYLKdtf vhNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="AbRNqM/f"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id c22-20020a056a00249600b0068fc49cc456si8340886pfv.248.2023.09.18.08.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 08:00:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="AbRNqM/f"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4ECF48029846; Mon, 18 Sep 2023 05:33:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241300AbjIRMdW (ORCPT + 27 others); Mon, 18 Sep 2023 08:33:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241302AbjIRMcz (ORCPT ); Mon, 18 Sep 2023 08:32:55 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC297107 for ; Mon, 18 Sep 2023 05:32:33 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2b9338e4695so70772651fa.2 for ; Mon, 18 Sep 2023 05:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1695040352; x=1695645152; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uqgSIBXgk25i53ApRC28zb/oSMjI8zuN4nMgi5m6KPw=; b=AbRNqM/fiJM/bE7wY1el3fMd89AufNmuIbzAXyP/5QHlTsHOg+ARZf6trUrHZq/Xhb BOFmIayEZTp+3s60XpqS0STJrjVchDiFxTD3tG33H9va2Dt6TwMsYLeByHvtgc0oM2l4 4C3/nzpD/NmS0UUlAYbhNQH7T6WVofV+cYp4ivcg7IXJ88YL79qbe+42uql8bznCzYwX lR4LPgcbgy4kOfQBQ+PCmYruQX7WvNkqRaNzvQGRruSZUiP+NTfx5tQbv8sofQ7pNiBS aQ5ZZPEHQia9sKjA+AeKEE7FEg37lGwZ3Jw4v8TIxU9JlnQ8n4oIwCNYL33gqhqqw6jo Obbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695040352; x=1695645152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uqgSIBXgk25i53ApRC28zb/oSMjI8zuN4nMgi5m6KPw=; b=o/CqDTTSQH8pUkEdk3IsRFAC/hI68ShzFh0ddOtAjYNoouAHOwdOrzF4N21jgS366r d3y09HBcjwgvPYY6ihCO17X8h4G6KvRh3AfdmaQ0XEKM50dnzad1rCfF/tcMgY4ixyvC 5Qnmd7rFxs29EnSjjvJSu1kM90sEVDx0cCU7ZKbexO5JG5pATZ1wezbSjZ0tgLZL7vtP uoVgHRPK6DHlBp9upun8lHC2Mjd5XQEvv/a1hpZ1/2ArF+bsqGJDKaZ/lLgIpcbEAmjO bVneqvzoaOtAeIXDOsvlGqe29COirLEc0753CI+o96y8kW7lg9rTcWn0WxmuUV9GpwG4 8d3w== X-Gm-Message-State: AOJu0YzlEPQOwx3jjVi+mRVlbAavoY8TnpYcQ3sFhv0YD87zdhbmGf+N QN8OYm7FOUXlpewj5APjC17QMg== X-Received: by 2002:a05:651c:1727:b0:2c0:1cfd:8698 with SMTP id be39-20020a05651c172700b002c01cfd8698mr679905ljb.36.1695040352145; Mon, 18 Sep 2023 05:32:32 -0700 (PDT) Received: from heron.intern.cm-ag (p200300dc6f209c00529a4cfffe3dd983.dip0.t-ipconnect.de. [2003:dc:6f20:9c00:529a:4cff:fe3d:d983]) by smtp.gmail.com with ESMTPSA id sd5-20020a170906ce2500b00992a8a54f32sm6328834ejb.139.2023.09.18.05.32.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 05:32:31 -0700 (PDT) From: Max Kellermann To: jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: amir73il@gmail.com, max.kellermann@ionos.com Subject: [PATCH 2/4] inotify_user: move code to do_inotify_add_watch() Date: Mon, 18 Sep 2023 14:32:15 +0200 Message-Id: <20230918123217.932179-2-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230918123217.932179-1-max.kellermann@ionos.com> References: <20230918123217.932179-1-max.kellermann@ionos.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 18 Sep 2023 05:33:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777387963005031138 X-GMAIL-MSGID: 1777387963005031138 Preparing for inotify_add_watch_at(). To: Jan Kara Cc: Amir Goldstein To: linux-fsdevel@vger.kernel.org To: linux-kernel@vger.kernel.org Signed-off-by: Max Kellermann --- fs/notify/inotify/inotify_user.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 1853439a24f6..b6e6f6ab21f8 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c @@ -727,8 +727,8 @@ SYSCALL_DEFINE0(inotify_init) return do_inotify_init(0); } -SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, - u32, mask) +static int do_inotify_add_watch(int fd, int dfd, const char __user *pathname, + u32 mask) { struct fsnotify_group *group; struct inode *inode; @@ -774,7 +774,7 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, if (mask & IN_ONLYDIR) flags |= LOOKUP_DIRECTORY; - ret = inotify_find_inode(AT_FDCWD, pathname, &path, flags, + ret = inotify_find_inode(dfd, pathname, &path, flags, (mask & IN_ALL_EVENTS)); if (ret) goto fput_and_out; @@ -791,6 +791,12 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, return ret; } +SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, + u32, mask) +{ + return do_inotify_add_watch(fd, AT_FDCWD, pathname, mask); +} + SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd) { struct fsnotify_group *group; From patchwork Mon Sep 18 12:32:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 141520 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2885675vqi; Mon, 18 Sep 2023 12:03:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErbHx5+fMvTR76AT9WgDD82A6NGEN3kutnrFM0ieLpLwsSwlEo5LHuDm3+L5McoVzUDV6L X-Received: by 2002:a05:6a20:4322:b0:133:1d62:dcbd with SMTP id h34-20020a056a20432200b001331d62dcbdmr424834pzk.28.1695063781449; Mon, 18 Sep 2023 12:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695063781; cv=none; d=google.com; s=arc-20160816; b=QtBZv60YKRZWYA2QjWBPw5YfClkSbdV8zFEqTX80MznK0ldBe0tQb3jfUj4Q9h0Ej/ qNe8eGw2RmmB2PZjFu7wSG8CFiNtszqJVIr+T55dkMeUWiEjSEY7yF8zFkPMvY46z5Vf noSoKj1ORjo1MCdVVklcUFJ8EKwgEA0YJutxjWkIRjZSjj1LMbo8QMIseHgH4auhCWOT lB2j4Tr7jducjpaesYH4hNJGbTxSDU1KYHWEn2eGF3SpfEgTJQAYiB7LHnWUdWZNjduB k/KkVVANe3WjSlIWD+csXHWca40NXbRiTyD0c0x+Hrj+jESBXgUD5MW7OF0t76mDz3Bw OseQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iVQUJ/L8+afXKT69wRIL26IHsJ0vcphHTUN9uWpD+6k=; fh=wd7qOuYAeNqOqTJ3FnCoYa4/XxYdErzLkNb6cLbRrzw=; b=tRsBGf1hITZ8H3dPxjusSOeZjjS/QUdptrhE/PblFUQyFMCDvtF82F09tFhQ4mSR+6 Lqga18ZEFlDdfWqWp3VXmZ6RTZnMSUhb9ywyVf6gWba1Ys1O89+laPlfx2vC54XjwdmV dQYlZN0WsEU65m5j0YYHnvGrjR7CX6tgmDMVG73Rm64z9GArgRIKWvWBQGo1HAV7fKWw 19uKdWm9W53rpzIDddsIJwejR5dWcFIBrjUUoa+QMesYppE5Vu5q4JvgKShdXfkEJYTY mp5dZI2IwvrXDi484rMKoyiR4C2ravU40QWo6v2JCXP+jRzCJpapOZwCpJ/VdXs4RdwA xtYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=ZVJDUei0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id o66-20020a634145000000b005777bea0b5esi8082527pga.901.2023.09.18.12.03.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 12:03:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=ZVJDUei0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CEC7C802923D; Mon, 18 Sep 2023 05:33:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241362AbjIRMdX (ORCPT + 27 others); Mon, 18 Sep 2023 08:33:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241330AbjIRMc4 (ORCPT ); Mon, 18 Sep 2023 08:32:56 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0264BC7 for ; Mon, 18 Sep 2023 05:32:36 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2bfed7c4e6dso31780671fa.1 for ; Mon, 18 Sep 2023 05:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1695040354; x=1695645154; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iVQUJ/L8+afXKT69wRIL26IHsJ0vcphHTUN9uWpD+6k=; b=ZVJDUei0T8xfdtWX15tKcApO5DRgqvWossHyS/Yo7okNpQcav0LIfkrrJ/dRxgUtoS dMbR5D4WEUPreV7wBLTlKjgC7dtk35RGPlh2PVFlIfMDntYOfK/E81js+s0ZonC3rg1I 1HD3KVIWrjTxMGDjGor7LqciO2j6GqTk03MS44Ojh+pz/omTEf/GWwnZlsQsQR/ljbtA NF/fyLltWyB4hnvTKdEqgWtjiXyU/8lnwAxzcuDESpZ89rXQ0saDf2oE+/lVAIw1Hwi/ V6AgiaGj6W+9mljljF+gJWWeHZYBb6MvNOFyntHkdDF1zqjJRpIJIMmD0yJdP1E77rZX UA7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695040354; x=1695645154; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iVQUJ/L8+afXKT69wRIL26IHsJ0vcphHTUN9uWpD+6k=; b=vRfx78iiIGx1Z7rIuYpFW5uCQSQJJqAIB+mxckxJ6rIWV40K/yRZWB5ddCN69dZ8F+ zg9vaD4WTvIajFBwIJ9ILJdN1/9lB9Uml0SxMjDo02rDinMmseQnSDpsFhj1B6aKAwY7 UqKyqODGNCnZmPMmAJxh4SJUhzmT3SFqHY5d6j8Q/rdQc/Stqw/YF0Ft0lr1oI8biSZV Ufkm+fYQfsDoJ4/in4uiYy25ahmalxGBtYDJkRFfJyfSArLDzVI9llTtXkpnzOOzBH6j PdRWYx2Z28IRDsjiGXiW93XXkaFvMx/Au75+qCeMIiIoNG/SUYhdBSijbhPoF245pf/Y 16LA== X-Gm-Message-State: AOJu0Yxp154QtULx21yXxKyPISsMvjbD1Em3Vh4k4YoudxnEMwJtupG4 qN+h60BhX+itoLesVLnXZrTimw== X-Received: by 2002:a2e:80d7:0:b0:2bc:ff80:f639 with SMTP id r23-20020a2e80d7000000b002bcff80f639mr7962895ljg.7.1695040354219; Mon, 18 Sep 2023 05:32:34 -0700 (PDT) Received: from heron.intern.cm-ag (p200300dc6f209c00529a4cfffe3dd983.dip0.t-ipconnect.de. [2003:dc:6f20:9c00:529a:4cff:fe3d:d983]) by smtp.gmail.com with ESMTPSA id sd5-20020a170906ce2500b00992a8a54f32sm6328834ejb.139.2023.09.18.05.32.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 05:32:33 -0700 (PDT) From: Max Kellermann To: jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: amir73il@gmail.com, max.kellermann@ionos.com Subject: [PATCH 3/4] inotify_user: add system call inotify_add_watch_at() Date: Mon, 18 Sep 2023 14:32:16 +0200 Message-Id: <20230918123217.932179-3-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230918123217.932179-1-max.kellermann@ionos.com> References: <20230918123217.932179-1-max.kellermann@ionos.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 18 Sep 2023 05:33:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777400033300350220 X-GMAIL-MSGID: 1777403199669237692 This implements a missing piece in the inotify API: referring to a file by a directory file descriptor and a path name. This can be solved in userspace currently only by doing something similar to: int old = open("."); fchdir(dfd); inotify_add_watch(....); fchdir(old); Support for LOOKUP_EMPTY is still missing. We could add another IN_* flag for that (which would clutter the IN_* flags list further) or add a "flags" parameter to the new system call (which would however duplicate features already present via special IN_* flags). To: Jan Kara Cc: Amir Goldstein To: linux-fsdevel@vger.kernel.org To: linux-kernel@vger.kernel.org Signed-off-by: Max Kellermann --- fs/notify/inotify/inotify_user.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index b6e6f6ab21f8..8a9096c5ebb1 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c @@ -797,6 +797,12 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, return do_inotify_add_watch(fd, AT_FDCWD, pathname, mask); } +SYSCALL_DEFINE4(inotify_add_watch_at, int, fd, int, dfd, const char __user *, pathname, + u32, mask) +{ + return do_inotify_add_watch(fd, dfd, pathname, mask); +} + SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd) { struct fsnotify_group *group; From patchwork Mon Sep 18 12:32:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 141405 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2626038vqi; Mon, 18 Sep 2023 05:41:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOn1q3q/1H5diOvKdf02ndsqlDlyDfAG3EUW8nURv1CsLwEeGVv6v/c3xHnnf/mWDS8aBL X-Received: by 2002:a17:902:b589:b0:1c0:c0af:ba59 with SMTP id a9-20020a170902b58900b001c0c0afba59mr6757447pls.34.1695040901896; Mon, 18 Sep 2023 05:41:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695040901; cv=none; d=google.com; s=arc-20160816; b=sVR0dsHOJzznYfxRgDI+z4SRjrkyKZ2jhCyLmSS4664mQI5vuSsq2pzXbsma4cH1VX tBU5Fz3+r1Tl7Nl7RUa7dLsSErLu2KA/GSEza6eRCv6aue1H5AHLpx8sH1lXTTu6BXBF 3WIxJwvUmX2odivZL9r0wCWrqSpiPjUzc+TMDow9f5boN6rtsj0+wpCj4anrSBP89Kuo YOFHPyt8FAHDKDAKvf6ZBVGyQ0f3O4QjHSljVTyX9iujdW9DfAdXVjL7lZElyvNOtVpS lS3Bj93m9Z+C7vShe+18+cuV5YA61Jt/VIGqKZdvcldIb/UdY84Vhf7RylhzkOzKwmKO JiQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0X6QtCgWBlGiAp6h0kF11KB6rl566Y3up0YcWsWItks=; fh=wd7qOuYAeNqOqTJ3FnCoYa4/XxYdErzLkNb6cLbRrzw=; b=L7LdG47epJ7d+vq1SPHRXmiVqScSzfUB8giQdvnDo8GqxDO7cqPVZnlNgthqYkupzq LwQQnm531V0ymu0qEvOr/41WTnlEdjvlswoOVK+SflKim4Z0+tQ5TWK0WadQLV8tPrpa bAbE7l/1ilOE+9x/374XAD9hVaxX+nWopTzafixpVPYS+jraPBnl4B2ToAZGyvZKhayw GyeTWTUrhYRaMrIs7nd+NtGZtyzNXwhb5/PSZ8ZGOQ5m0239/Si7ENtFHxN3wnaZQm3r 2pxfZsB3Ie6r6ECS2KetYY0aVprufSmJkdQ9QYRpBSyMYY3tlBXXn8qBbx7syONepjvA L0iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=Tj2vtYb6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id b17-20020a170902d51100b001bb23874273si8261854plg.220.2023.09.18.05.41.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 05:41:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=Tj2vtYb6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 9E8808029543; Mon, 18 Sep 2023 05:34:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241474AbjIRMd0 (ORCPT + 27 others); Mon, 18 Sep 2023 08:33:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241364AbjIRMc6 (ORCPT ); Mon, 18 Sep 2023 08:32:58 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05AE9130 for ; Mon, 18 Sep 2023 05:32:39 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9adb9fa7200so898220966b.0 for ; Mon, 18 Sep 2023 05:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1695040357; x=1695645157; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0X6QtCgWBlGiAp6h0kF11KB6rl566Y3up0YcWsWItks=; b=Tj2vtYb6TouL5/hGJnJfRgF1fUCrUMB9K0ph236O723alETthSQocRNC6PdHDca5Kb 9Ss13k7zOLBqEl6KbNyO6WdJ0svtavKwKgbcXvp5D7zAJvJB3lJ0OfMtATpOV5z36YTJ DDju7F+coo+B30W680ZWth7+8Sc1wu36ghxprFL6Zkh3oqsxCB2GUY5QRY9pF8eI+rx3 Bb6Nb+/DigcQ9zH/li6koN2JpH4l/wcT3wPubReXZACWUjNlf/fzOLfAHm1zEVxWrho0 u4wFXJi1soAWyKaCgYgYvmsrH+NH7tJTWQJwB5X5lpjVkvLvTeEpRD1C/dSJi4TpCw4m +byA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695040357; x=1695645157; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0X6QtCgWBlGiAp6h0kF11KB6rl566Y3up0YcWsWItks=; b=pefHNKGpTF1J5l28zVKhiXOKfVm7C5ZK0XuIoDXshtMcpTzoXXpg9LvwYvrKoU3jes Ri35bk8IL59s99UQcyCkh5nu+CG7vh6mbLVza0n1BYzjU5qAb9ul/lsE8dW+EqS+yFAy 5me1M1lOcKhXlF/YO3z/nmO/haaf8HLolDs30N5YWEh5tfgcEEuEbs3LX3EaIQyXTL+v ArEq0VkEymdFKiLUIimEkI6CsJcUaiJbuFbUhxguVNwDuJIB32C0MKpTU0hMqtWI6y9k G7VSV+wdZ3GTfdgIkDpEFCj0HhyTqMKp1BEIRQZHogHzVYrYB/1/6/BzsSuehMxqSsP8 mFog== X-Gm-Message-State: AOJu0YwYY6LDH1mJ+U0FmFhNdL3+soh4lCtUCTinw0UfcQXZZh5QS4KM 9T8nUxyfqUhbLHRlJ/pk0zs3ig== X-Received: by 2002:a17:906:eec5:b0:9a1:aaae:8207 with SMTP id wu5-20020a170906eec500b009a1aaae8207mr16145626ejb.20.1695040357404; Mon, 18 Sep 2023 05:32:37 -0700 (PDT) Received: from heron.intern.cm-ag (p200300dc6f209c00529a4cfffe3dd983.dip0.t-ipconnect.de. [2003:dc:6f20:9c00:529a:4cff:fe3d:d983]) by smtp.gmail.com with ESMTPSA id sd5-20020a170906ce2500b00992a8a54f32sm6328834ejb.139.2023.09.18.05.32.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 05:32:35 -0700 (PDT) From: Max Kellermann To: jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: amir73il@gmail.com, max.kellermann@ionos.com Subject: [PATCH 4/4] arch: register inotify_add_watch_at Date: Mon, 18 Sep 2023 14:32:17 +0200 Message-Id: <20230918123217.932179-4-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230918123217.932179-1-max.kellermann@ionos.com> References: <20230918123217.932179-1-max.kellermann@ionos.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 18 Sep 2023 05:34:09 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777379208657452704 X-GMAIL-MSGID: 1777379208657452704 Using syscall number 454 (only different on Alpha). This skips 453 on most architectures; 453 is used on x86_64 for "map_shadow_stack" and my idea is to reserve that number for the remaining architectures, where an implementation may be added eventually. Signed-off-by: Max Kellermann --- arch/alpha/kernel/syscalls/syscall.tbl | 1 + arch/arm/tools/syscall.tbl | 1 + arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 2 ++ arch/ia64/kernel/syscalls/syscall.tbl | 1 + arch/m68k/kernel/syscalls/syscall.tbl | 1 + arch/microblaze/kernel/syscalls/syscall.tbl | 1 + arch/mips/kernel/syscalls/syscall_n32.tbl | 1 + arch/mips/kernel/syscalls/syscall_n64.tbl | 1 + arch/mips/kernel/syscalls/syscall_o32.tbl | 1 + arch/parisc/kernel/syscalls/syscall.tbl | 1 + arch/powerpc/kernel/syscalls/syscall.tbl | 1 + arch/s390/kernel/syscalls/syscall.tbl | 1 + arch/sh/kernel/syscalls/syscall.tbl | 1 + arch/sparc/kernel/syscalls/syscall.tbl | 1 + arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + arch/xtensa/kernel/syscalls/syscall.tbl | 1 + include/linux/syscalls.h | 2 ++ include/uapi/asm-generic/unistd.h | 5 ++++- 20 files changed, 25 insertions(+), 2 deletions(-) diff --git a/arch/alpha/kernel/syscalls/syscall.tbl b/arch/alpha/kernel/syscalls/syscall.tbl index ad37569d0507..3eaf0c8ffe9c 100644 --- a/arch/alpha/kernel/syscalls/syscall.tbl +++ b/arch/alpha/kernel/syscalls/syscall.tbl @@ -492,3 +492,4 @@ 560 common set_mempolicy_home_node sys_ni_syscall 561 common cachestat sys_cachestat 562 common fchmodat2 sys_fchmodat2 +563 common inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl index c572d6c3dee0..08fc73bf211c 100644 --- a/arch/arm/tools/syscall.tbl +++ b/arch/arm/tools/syscall.tbl @@ -466,3 +466,4 @@ 450 common set_mempolicy_home_node sys_set_mempolicy_home_node 451 common cachestat sys_cachestat 452 common fchmodat2 sys_fchmodat2 +454 common inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index bd77253b62e0..63a8a9c4abc1 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h @@ -39,7 +39,7 @@ #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5) #define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800) -#define __NR_compat_syscalls 453 +#define __NR_compat_syscalls 455 #endif #define __ARCH_WANT_SYS_CLONE diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 78b68311ec81..384c121dfbdf 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h @@ -911,6 +911,8 @@ __SYSCALL(__NR_set_mempolicy_home_node, sys_set_mempolicy_home_node) __SYSCALL(__NR_cachestat, sys_cachestat) #define __NR_fchmodat2 452 __SYSCALL(__NR_fchmodat2, sys_fchmodat2) +#define __NR_inotify_add_watch_at 454 +__SYSCALL(__NR_inotify_add_watch_at, sys_inotify_add_watch_at) /* * Please add new compat syscalls above this comment and update diff --git a/arch/ia64/kernel/syscalls/syscall.tbl b/arch/ia64/kernel/syscalls/syscall.tbl index 83d8609aec03..8312606fdcd7 100644 --- a/arch/ia64/kernel/syscalls/syscall.tbl +++ b/arch/ia64/kernel/syscalls/syscall.tbl @@ -373,3 +373,4 @@ 450 common set_mempolicy_home_node sys_set_mempolicy_home_node 451 common cachestat sys_cachestat 452 common fchmodat2 sys_fchmodat2 +454 common inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/m68k/kernel/syscalls/syscall.tbl b/arch/m68k/kernel/syscalls/syscall.tbl index 259ceb125367..51de66ce3e9b 100644 --- a/arch/m68k/kernel/syscalls/syscall.tbl +++ b/arch/m68k/kernel/syscalls/syscall.tbl @@ -452,3 +452,4 @@ 450 common set_mempolicy_home_node sys_set_mempolicy_home_node 451 common cachestat sys_cachestat 452 common fchmodat2 sys_fchmodat2 +454 common inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/microblaze/kernel/syscalls/syscall.tbl b/arch/microblaze/kernel/syscalls/syscall.tbl index a3798c2637fd..991a0ae1c4be 100644 --- a/arch/microblaze/kernel/syscalls/syscall.tbl +++ b/arch/microblaze/kernel/syscalls/syscall.tbl @@ -458,3 +458,4 @@ 450 common set_mempolicy_home_node sys_set_mempolicy_home_node 451 common cachestat sys_cachestat 452 common fchmodat2 sys_fchmodat2 +454 common inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/mips/kernel/syscalls/syscall_n32.tbl b/arch/mips/kernel/syscalls/syscall_n32.tbl index 152034b8e0a0..98a7c7c45293 100644 --- a/arch/mips/kernel/syscalls/syscall_n32.tbl +++ b/arch/mips/kernel/syscalls/syscall_n32.tbl @@ -391,3 +391,4 @@ 450 n32 set_mempolicy_home_node sys_set_mempolicy_home_node 451 n32 cachestat sys_cachestat 452 n32 fchmodat2 sys_fchmodat2 +454 n32 inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/mips/kernel/syscalls/syscall_n64.tbl b/arch/mips/kernel/syscalls/syscall_n64.tbl index cb5e757f6621..8751f6de6b96 100644 --- a/arch/mips/kernel/syscalls/syscall_n64.tbl +++ b/arch/mips/kernel/syscalls/syscall_n64.tbl @@ -367,3 +367,4 @@ 450 common set_mempolicy_home_node sys_set_mempolicy_home_node 451 n64 cachestat sys_cachestat 452 n64 fchmodat2 sys_fchmodat2 +454 n64 inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/mips/kernel/syscalls/syscall_o32.tbl b/arch/mips/kernel/syscalls/syscall_o32.tbl index 1a646813afdc..a899807b3b64 100644 --- a/arch/mips/kernel/syscalls/syscall_o32.tbl +++ b/arch/mips/kernel/syscalls/syscall_o32.tbl @@ -440,3 +440,4 @@ 450 o32 set_mempolicy_home_node sys_set_mempolicy_home_node 451 o32 cachestat sys_cachestat 452 o32 fchmodat2 sys_fchmodat2 +454 o32 inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/parisc/kernel/syscalls/syscall.tbl b/arch/parisc/kernel/syscalls/syscall.tbl index e97c175b56f9..325885297d5d 100644 --- a/arch/parisc/kernel/syscalls/syscall.tbl +++ b/arch/parisc/kernel/syscalls/syscall.tbl @@ -451,3 +451,4 @@ 450 common set_mempolicy_home_node sys_set_mempolicy_home_node 451 common cachestat sys_cachestat 452 common fchmodat2 sys_fchmodat2 +454 common inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl index 20e50586e8a2..132876dc7aa5 100644 --- a/arch/powerpc/kernel/syscalls/syscall.tbl +++ b/arch/powerpc/kernel/syscalls/syscall.tbl @@ -539,3 +539,4 @@ 450 nospu set_mempolicy_home_node sys_set_mempolicy_home_node 451 common cachestat sys_cachestat 452 common fchmodat2 sys_fchmodat2 +454 common inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl index 0122cc156952..b6d29996190c 100644 --- a/arch/s390/kernel/syscalls/syscall.tbl +++ b/arch/s390/kernel/syscalls/syscall.tbl @@ -455,3 +455,4 @@ 450 common set_mempolicy_home_node sys_set_mempolicy_home_node sys_set_mempolicy_home_node 451 common cachestat sys_cachestat sys_cachestat 452 common fchmodat2 sys_fchmodat2 sys_fchmodat2 +454 common inotify_add_watch_at sys_inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/sh/kernel/syscalls/syscall.tbl b/arch/sh/kernel/syscalls/syscall.tbl index e90d585c4d3e..337875016443 100644 --- a/arch/sh/kernel/syscalls/syscall.tbl +++ b/arch/sh/kernel/syscalls/syscall.tbl @@ -455,3 +455,4 @@ 450 common set_mempolicy_home_node sys_set_mempolicy_home_node 451 common cachestat sys_cachestat 452 common fchmodat2 sys_fchmodat2 +454 common inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/sparc/kernel/syscalls/syscall.tbl b/arch/sparc/kernel/syscalls/syscall.tbl index 4ed06c71c43f..9634f81be406 100644 --- a/arch/sparc/kernel/syscalls/syscall.tbl +++ b/arch/sparc/kernel/syscalls/syscall.tbl @@ -498,3 +498,4 @@ 450 common set_mempolicy_home_node sys_set_mempolicy_home_node 451 common cachestat sys_cachestat 452 common fchmodat2 sys_fchmodat2 +454 common inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl index 2d0b1bd866ea..de83d6861429 100644 --- a/arch/x86/entry/syscalls/syscall_32.tbl +++ b/arch/x86/entry/syscalls/syscall_32.tbl @@ -457,3 +457,4 @@ 450 i386 set_mempolicy_home_node sys_set_mempolicy_home_node 451 i386 cachestat sys_cachestat 452 i386 fchmodat2 sys_fchmodat2 +454 i386 inotify_add_watch_at sys_inotify_add_watch_at diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl index 1d6eee30eceb..fdf0128fffce 100644 --- a/arch/x86/entry/syscalls/syscall_64.tbl +++ b/arch/x86/entry/syscalls/syscall_64.tbl @@ -375,6 +375,7 @@ 451 common cachestat sys_cachestat 452 common fchmodat2 sys_fchmodat2 453 64 map_shadow_stack sys_map_shadow_stack +454 common inotify_add_watch_at sys_inotify_add_watch_at # # Due to a historical design error, certain syscalls are numbered differently diff --git a/arch/xtensa/kernel/syscalls/syscall.tbl b/arch/xtensa/kernel/syscalls/syscall.tbl index fc1a4f3c81d9..43cbdd8f369c 100644 --- a/arch/xtensa/kernel/syscalls/syscall.tbl +++ b/arch/xtensa/kernel/syscalls/syscall.tbl @@ -423,3 +423,4 @@ 450 common set_mempolicy_home_node sys_set_mempolicy_home_node 451 common cachestat sys_cachestat 452 common fchmodat2 sys_fchmodat2 +454 common inotify_add_watch_at sys_inotify_add_watch_at diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 22bc6bc147f8..63349ee93cb3 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -379,6 +379,8 @@ asmlinkage long sys_fcntl64(unsigned int fd, asmlinkage long sys_inotify_init1(int flags); asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, u32 mask); +asmlinkage long sys_inotify_add_watch_at(int fd, int dfd, const char __user *path, + u32 mask); asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd); asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index abe087c53b4b..f84bdb800352 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -823,8 +823,11 @@ __SYSCALL(__NR_cachestat, sys_cachestat) #define __NR_fchmodat2 452 __SYSCALL(__NR_fchmodat2, sys_fchmodat2) +#define __NR_inotify_add_watch_at 454 +__SYSCALL(__NR_inotify_add_watch_at, sys_inotify_add_watch_at) + #undef __NR_syscalls -#define __NR_syscalls 453 +#define __NR_syscalls 455 /* * 32 bit systems traditionally used different