get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2196546/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2196546,
    "url": "http://patchwork.ozlabs.org/api/patches/2196546/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260214175237.13794-1-always.starving0@gmail.com/",
    "project": {
        "id": 59,
        "url": "http://patchwork.ozlabs.org/api/projects/59/?format=api",
        "name": "Linux Test Project development",
        "link_name": "ltp",
        "list_id": "ltp.lists.linux.it",
        "list_email": "ltp@lists.linux.it",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260214175237.13794-1-always.starving0@gmail.com>",
    "list_archive_url": null,
    "date": "2026-02-14T17:52:37",
    "name": "inotify: cleanup - limit masks, use SAFE_ wrappers",
    "commit_ref": null,
    "pull_url": null,
    "state": "needs-review-ack",
    "archived": false,
    "hash": "81b7596046fdb6672dee91bfe7f45364164636bb",
    "submitter": {
        "id": 92589,
        "url": "http://patchwork.ozlabs.org/api/people/92589/?format=api",
        "name": "Jinseok Kim",
        "email": "always.starving0@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260214175237.13794-1-always.starving0@gmail.com/mbox/",
    "series": [
        {
            "id": 492188,
            "url": "http://patchwork.ozlabs.org/api/series/492188/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=492188",
            "date": "2026-02-14T17:52:37",
            "name": "inotify: cleanup - limit masks, use SAFE_ wrappers",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/492188/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2196546/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/2196546/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "ltp@lists.linux.it"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "ltp@picard.linux.it"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=DSust+yN;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fCxTg4zgLz1xwj\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 15 Feb 2026 04:53:09 +1100 (AEDT)",
            "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 0B0F13D02A0\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 14 Feb 2026 18:53:07 +0100 (CET)",
            "from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::6])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 966E13CFB42\n for <ltp@lists.linux.it>; Sat, 14 Feb 2026 18:53:02 +0100 (CET)",
            "from mail-pf1-x443.google.com (mail-pf1-x443.google.com\n [IPv6:2607:f8b0:4864:20::443])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-6.smtp.seeweb.it (Postfix) with ESMTPS id F035F14001E5\n for <ltp@lists.linux.it>; Sat, 14 Feb 2026 18:53:01 +0100 (CET)",
            "by mail-pf1-x443.google.com with SMTP id\n d2e1a72fcca58-823075fed75so1141640b3a.1\n for <ltp@lists.linux.it>; Sat, 14 Feb 2026 09:53:01 -0800 (PST)",
            "from localhost.localdomain ([59.16.109.172])\n by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-824c6a3e145sm5527773b3a.16.2026.02.14.09.52.58\n for <ltp@lists.linux.it>\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sat, 14 Feb 2026 09:52:59 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1771091580; x=1771696380; darn=lists.linux.it;\n h=content-transfer-encoding:mime-version:message-id:date:subject:to\n :from:from:to:cc:subject:date:message-id:reply-to;\n bh=3+5EJCkp7WWhMhFbtfDWsFB7Tg1zhVmEH5gNG+rEO0E=;\n b=DSust+yNHT8ga487rLv0GjPveVCHArc0TKFxmmrA8FL0XTIS0DpyOdOdV7P1RkvFaX\n iqGNbB5TyE9YryiWtV74vkxcE6PakeOBHIRL4DXG90ZZYs95QlRDcwKoAOckxDECvrwC\n cNii1Xlu09Jgvtfca1ILCQzke1ZeZaKKONdO7se34nymRBtIQ0kFiGBvLejYo17cI3i9\n FTpAuFjQYX34KW5lvlWpzBEW9hsKylFfv1D6kMvMsJofhozH7ZgeTXRNdciSFQQUB0/8\n Tl86J0eIvcZYajm3JxkIJZudy2MLauyS94nKmBL0HSsXaAuXkrWFcFHeiEQnNadPgGtI\n 0u4A==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771091580; x=1771696380;\n h=content-transfer-encoding:mime-version:message-id:date:subject:to\n :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=3+5EJCkp7WWhMhFbtfDWsFB7Tg1zhVmEH5gNG+rEO0E=;\n b=jVMJavLz729EJXUpT3PsE9RqAmMt8dv6b13GunICQ1YO8o4hmMZ19zb/VY8lTSyxg9\n 4KmYdqh7hWAJuezUNBOa+XkxI6ta0EqrIGu7aNwBhQrUkxi89MCgSudnTJiJtrjdtwvK\n HXjtYUivrQqeDbxYM1aHrH+vJ/sk4gKDIw8W+C5FSqjw8ffep7rPGnGpZH46+EDP5y7z\n mgZK9zzf8KguCyr7oF2bsGRohw/fUrTw9rqAawgHJcdvfsGANSaS9M2NTQsceMyCzyMj\n Tl2QecGKPXW4jWfzjhOuA2LZ4dRgQNOl/aL0cDfksPkTHuakBq7kJjxVyaA20uMu0jCz\n Fxvw==",
        "X-Gm-Message-State": "AOJu0YxvGcpt2NgMwjUixG1eS1vs0RZ0vTdvpmAd8w06Tw5kqHBAp8c0\n 0IcZSJSTUhGd7d0hcFZ9gSKFoaKKvazHjvJACsFyRw6CXMgOg+JocfMnH7SktvInTw==",
        "X-Gm-Gg": "AZuq6aJN+iXVsDdN9RuWWrYzypz4TygK+RceLjXVVD84VVVTM6G5p2wvP4SPZGL5LTf\n 45MEmJAaE/4ZVqzkAhZbcoDcBrJsuE87RN/rnx5Y5WQtzN2Gd0JK/O1e+Ff+g5kHkDXjU8xat15\n 2Q1+b7bbmF1LOebgBLPr79v3geTao3JpR8EQAwphryDsU9DGsxKQLYt/UFtU2zDAntgfE1HM6L9\n YU4EVMqQzJHLSLuISV0Qbi4RWjAtSgZoUzJJdyvgGKVQ/MtfJmjY5wrvfJdp41KhZDfJ+EL2Sr9\n ghF9/5dbclZWnmaFDqLfcPRoRTPRIo725ySIE/HkuO5Hhd/CNGCjwf6uL5pz2Dvh0TcCwOETdok\n RaG3drlQwqPpM/x6XTGM4C8J7D96EsQ6IdgMaaob5dcDth+190ezBFd1eUz7/6+h9Aj9V4AKLCy\n 5Z7bELTrlT/59AvB93AI45pj6FoS+WznxqR+t0BQf0XA==",
        "X-Received": "by 2002:a05:6a00:bc10:b0:81f:832a:174 with SMTP id\n d2e1a72fcca58-824d5e1c726mr3260303b3a.16.1771091579841;\n Sat, 14 Feb 2026 09:52:59 -0800 (PST)",
        "From": "Jinseok Kim <always.starving0@gmail.com>",
        "To": "ltp@lists.linux.it",
        "Date": "Sun, 15 Feb 2026 02:52:37 +0900",
        "Message-ID": "<20260214175237.13794-1-always.starving0@gmail.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "MIME-Version": "1.0",
        "X-Spam-Status": "No, score=0.3 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,\n SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on in-6.smtp.seeweb.it",
        "X-Virus-Scanned": "clamav-milter 1.0.9 at in-6.smtp.seeweb.it",
        "X-Virus-Status": "Clean",
        "Subject": "[LTP] [PATCH] inotify: cleanup - limit masks, use SAFE_ wrappers",
        "X-BeenThere": "ltp@lists.linux.it",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Linux Test Project <ltp.lists.linux.it>",
        "List-Unsubscribe": "<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>",
        "List-Archive": "<http://lists.linux.it/pipermail/ltp/>",
        "List-Post": "<mailto:ltp@lists.linux.it>",
        "List-Help": "<mailto:ltp-request@lists.linux.it?subject=help>",
        "List-Subscribe": "<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it",
        "Sender": "\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"
    },
    "content": "Replace IN_ALL_EVENTS with minimal relevant masks and manual read/write\nwith SAFE_READ/SAFE_WRITE for better stability and consistency.\n\ninotify12.c intentionally unchanged: raw read() + manual EAGAIN handling\nis required to treat missing second event as IN_IGNORED (normal case).\n\nSigned-off-by: Jinseok Kim <always.starving0@gmail.com>\n---\n testcases/kernel/syscalls/inotify/inotify01.c | 21 ++++++-------------\n testcases/kernel/syscalls/inotify/inotify02.c |  5 ++++-\n testcases/kernel/syscalls/inotify/inotify03.c | 16 +++-----------\n testcases/kernel/syscalls/inotify/inotify04.c | 10 ++++-----\n testcases/kernel/syscalls/inotify/inotify05.c | 10 +++------\n testcases/kernel/syscalls/inotify/inotify07.c | 10 +++------\n testcases/kernel/syscalls/inotify/inotify08.c |  7 +------\n testcases/kernel/syscalls/inotify/inotify10.c |  4 +---\n 8 files changed, 26 insertions(+), 57 deletions(-)\n\n--\n2.43.0",
    "diff": "diff --git a/testcases/kernel/syscalls/inotify/inotify01.c b/testcases/kernel/syscalls/inotify/inotify01.c\nindex 8671b594a..f58784ffd 100644\n--- a/testcases/kernel/syscalls/inotify/inotify01.c\n+++ b/testcases/kernel/syscalls/inotify/inotify01.c\n@@ -55,10 +55,7 @@ void verify_inotify(void)\n \tevent_set[test_cnt] = IN_OPEN;\n \ttest_cnt++;\n\n-\tif (read(fd, buf, BUF_SIZE) == -1) {\n-\t\ttst_brk(TBROK | TERRNO,\n-\t\t\t\"read(%d, buf, %d) failed\", fd, BUF_SIZE);\n-\t}\n+\tSAFE_READ(0, fd, buf, BUF_SIZE);\n \tevent_set[test_cnt] = IN_ACCESS;\n \ttest_cnt++;\n\n@@ -70,10 +67,7 @@ void verify_inotify(void)\n \tevent_set[test_cnt] = IN_OPEN;\n \ttest_cnt++;\n\n-\tif (write(fd, buf, BUF_SIZE) == -1) {\n-\t\ttst_brk(TBROK,\n-\t\t\t\"write(%d, %s, %d) failed\", fd, fname, BUF_SIZE);\n-\t}\n+\tSAFE_WRITE(SAFE_WRITE_ALL, fd, buf, BUF_SIZE);\n \tevent_set[test_cnt] = IN_MODIFY;\n \ttest_cnt++;\n\n@@ -85,12 +79,7 @@ void verify_inotify(void)\n \t * get list of events\n \t */\n \tint len, i = 0, test_num = 0;\n-\tif ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) < 0) {\n-\t\ttst_brk(TBROK,\n-\t\t\t\"read(%d, buf, %zu) failed\",\n-\t\t\tfd_notify, EVENT_BUF_LEN);\n-\n-\t}\n+\tlen = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN);\n\n \t/*\n \t * check events\n@@ -143,7 +132,9 @@ static void setup(void)\n\n \tfd_notify = SAFE_MYINOTIFY_INIT();\n\n-\twd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, fname, IN_ALL_EVENTS);\n+\twd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, fname, IN_ATTRIB | IN_OPEN |\n+\t\t\t\t      IN_ACCESS | IN_CLOSE_NOWRITE | IN_MODIFY |\n+\t\t\t\t      IN_CLOSE_WRITE);\n \treap_wd = 1;\n }\n\ndiff --git a/testcases/kernel/syscalls/inotify/inotify02.c b/testcases/kernel/syscalls/inotify/inotify02.c\nindex 314c1bd49..a842abeee 100644\n--- a/testcases/kernel/syscalls/inotify/inotify02.c\n+++ b/testcases/kernel/syscalls/inotify/inotify02.c\n@@ -187,7 +187,10 @@ static void setup(void)\n {\n \tfd_notify = SAFE_MYINOTIFY_INIT();\n\n-\twd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, \".\", IN_ALL_EVENTS);\n+\twd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, \".\", IN_ATTRIB | IN_CREATE |\n+\t\t\t\t      IN_OPEN | IN_CLOSE_WRITE |\n+\t\t\t\t      IN_MOVED_FROM | IN_MOVED_TO |\n+\t\t\t\t      IN_MOVE_SELF | IN_DELETE);\n \treap_wd = 1;\n }\n\ndiff --git a/testcases/kernel/syscalls/inotify/inotify03.c b/testcases/kernel/syscalls/inotify/inotify03.c\nindex 9bb95addb..5d141fbb5 100644\n--- a/testcases/kernel/syscalls/inotify/inotify03.c\n+++ b/testcases/kernel/syscalls/inotify/inotify03.c\n@@ -55,7 +55,7 @@ void verify_inotify(void)\n \tSAFE_MOUNT(tst_device->dev, mntpoint, tst_device->fs_type, 0, NULL);\n \tmount_flag = 1;\n\n-\twd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, fname, IN_ALL_EVENTS);\n+\twd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, fname, IN_UNMOUNT | IN_IGNORED);\n\n \tevent_set[test_cnt] = IN_UNMOUNT;\n \ttest_cnt++;\n@@ -74,11 +74,7 @@ void verify_inotify(void)\n \t}\n \tmount_flag = 0;\n\n-\tlen = read(fd_notify, event_buf, EVENT_BUF_LEN);\n-\tif (len < 0) {\n-\t\ttst_brk(TBROK | TERRNO,\n-\t\t\t\"read(%d, buf, %zu) failed\", fd_notify, EVENT_BUF_LEN);\n-\t}\n+\tlen = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN);\n\n \t/* check events */\n \ttest_num = 0;\n@@ -125,8 +121,6 @@ void verify_inotify(void)\n\n static void setup(void)\n {\n-\tint ret;\n-\n \tSAFE_MKDIR(mntpoint, DIR_MODE);\n\n \tSAFE_MOUNT(tst_device->dev, mntpoint, tst_device->fs_type, 0, NULL);\n@@ -135,11 +129,7 @@ static void setup(void)\n \tsprintf(fname, \"%s/tfile_%d\", mntpoint, getpid());\n \tfd = SAFE_OPEN(fname, O_RDWR | O_CREAT, 0700);\n\n-\tret = write(fd, fname, 1);\n-\tif (ret == -1) {\n-\t\ttst_brk(TBROK | TERRNO,\n-\t\t\t \"write(%d, %s, 1) failed\", fd, fname);\n-\t}\n+\tSAFE_WRITE(SAFE_WRITE_ALL, fd, fname, 1);\n\n \t/* close the file we have open */\n \tSAFE_CLOSE(fd);\ndiff --git a/testcases/kernel/syscalls/inotify/inotify04.c b/testcases/kernel/syscalls/inotify/inotify04.c\nindex 1db38ddf2..1472bcff0 100644\n--- a/testcases/kernel/syscalls/inotify/inotify04.c\n+++ b/testcases/kernel/syscalls/inotify/inotify04.c\n@@ -81,10 +81,12 @@ void verify_inotify(void)\n \tSAFE_MKDIR(TEST_DIR, 00700);\n \tclose(SAFE_CREAT(TEST_FILE, 00600));\n\n-\twd_dir = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_DIR, IN_ALL_EVENTS);\n+\twd_dir = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_DIR, IN_DELETE_SELF |\n+\t\t\t\t\t  IN_ATTRIB | IN_IGNORED);\n \treap_wd_dir = 1;\n\n-\twd_file = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_FILE, IN_ALL_EVENTS);\n+\twd_file = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, TEST_FILE, IN_DELETE_SELF |\n+\t\t\t\t\t   IN_ATTRIB | IN_IGNORED);\n \treap_wd_file = 1;\n\n \tSAFE_RMDIR(TEST_DIR);\n@@ -118,9 +120,7 @@ void verify_inotify(void)\n \tstrcpy(event_set[test_cnt].name, \"\");\n \ttest_cnt++;\n\n-\tlen = read(fd_notify, event_buf, EVENT_BUF_LEN);\n-\tif (len == -1)\n-\t\ttst_brk(TBROK | TERRNO, \"read failed\");\n+\tlen = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN);\n\n \twhile (i < len) {\n \t\tstruct inotify_event *event;\ndiff --git a/testcases/kernel/syscalls/inotify/inotify05.c b/testcases/kernel/syscalls/inotify/inotify05.c\nindex d9bfb05f1..d1e35b735 100644\n--- a/testcases/kernel/syscalls/inotify/inotify05.c\n+++ b/testcases/kernel/syscalls/inotify/inotify05.c\n@@ -60,12 +60,7 @@ void verify_inotify(void)\n \t\t/*\n \t\t * get list on events\n \t\t */\n-\t\tlen = read(fd_notify, event_buf, EVENT_BUF_LEN);\n-\t\tif (len < 0) {\n-\t\t\ttst_brk(TBROK | TERRNO,\n-\t\t\t\t\"read(%d, buf, %zu) failed\",\n-\t\t\t\tfd_notify, EVENT_BUF_LEN);\n-\t\t}\n+\t\tlen = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN);\n\n \t\t/*\n \t\t * check events\n@@ -128,7 +123,8 @@ static void setup(void)\n\n \tfd_notify = SAFE_MYINOTIFY_INIT1(O_NONBLOCK);\n\n-\twd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, fname, IN_ALL_EVENTS);\n+\twd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, fname, IN_ACCESS | IN_MODIFY |\n+\t\t\t\t      IN_OPEN | IN_Q_OVERFLOW);\n\n \tSAFE_FILE_SCANF(\"/proc/sys/fs/inotify/max_queued_events\",\n \t\t\t\"%d\", &max_events);\ndiff --git a/testcases/kernel/syscalls/inotify/inotify07.c b/testcases/kernel/syscalls/inotify/inotify07.c\nindex 66a2f4d37..55d03377c 100644\n--- a/testcases/kernel/syscalls/inotify/inotify07.c\n+++ b/testcases/kernel/syscalls/inotify/inotify07.c\n@@ -88,12 +88,7 @@ void verify_inotify(void)\n \tstrcpy(event_set[test_cnt].name, FILE_NAME);\n \ttest_cnt++;\n\n-\tint len = read(fd_notify, event_buf, EVENT_BUF_LEN);\n-\tif (len == -1 && errno != EAGAIN) {\n-\t\ttst_brk(TBROK | TERRNO,\n-\t\t\t\"read(%d, buf, %zu) failed\",\n-\t\t\tfd_notify, EVENT_BUF_LEN);\n-\t}\n+\tint len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN);\n\n \tint i = 0, test_num = 0;\n \twhile (i < len) {\n@@ -151,7 +146,8 @@ static void setup(void)\n \tfd_notify = SAFE_MYINOTIFY_INIT1(O_NONBLOCK);\n\n \t/* Setup a watch on an overlayfs lower directory */\n-\twd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, DIR_PATH, IN_ALL_EVENTS);\n+\twd = SAFE_MYINOTIFY_ADD_WATCH(fd_notify, DIR_PATH, IN_ATTRIB | IN_OPEN |\n+\t\t\t\t      IN_CLOSE_WRITE);\n \treap_wd = 1;\n\n \tSAFE_STAT(DIR_PATH, &buf);\ndiff --git a/testcases/kernel/syscalls/inotify/inotify08.c b/testcases/kernel/syscalls/inotify/inotify08.c\nindex 4cbb16ce0..e0837cac3 100644\n--- a/testcases/kernel/syscalls/inotify/inotify08.c\n+++ b/testcases/kernel/syscalls/inotify/inotify08.c\n@@ -86,12 +86,7 @@ void verify_inotify(void)\n \tSAFE_TOUCH(OVL_LOWER\"/\"FILE_NAME, 0644, NULL);\n \tSAFE_TOUCH(OVL_UPPER\"/\"FILE_NAME, 0644, NULL);\n\n-\tint len = read(fd_notify, event_buf, EVENT_BUF_LEN);\n-\tif (len == -1 && errno != EAGAIN) {\n-\t\ttst_brk(TBROK | TERRNO,\n-\t\t\t\"read(%d, buf, %zu) failed\",\n-\t\t\tfd_notify, EVENT_BUF_LEN);\n-\t}\n+\tint len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN);\n\n \tint i = 0, test_num = 0;\n \twhile (i < len) {\ndiff --git a/testcases/kernel/syscalls/inotify/inotify10.c b/testcases/kernel/syscalls/inotify/inotify10.c\nindex a78572dff..4c3a1d116 100644\n--- a/testcases/kernel/syscalls/inotify/inotify10.c\n+++ b/testcases/kernel/syscalls/inotify/inotify10.c\n@@ -143,9 +143,7 @@ static void verify_inotify(unsigned int n)\n \t\ttest_cnt++;\n \t}\n\n-\tlen = read(fd_notify, event_buf, EVENT_BUF_LEN);\n-\tif (len == -1)\n-\t\ttst_brk(TBROK | TERRNO, \"read failed\");\n+\tlen = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN);\n\n \twhile (i < len) {\n \t\tstruct event_t *expected = &event_set[test_num];\n",
    "prefixes": []
}