[{"id":3684129,"web_url":"http://patchwork.ozlabs.org/comment/3684129/","msgid":"<20260429151834.3982-1-linuxtestproject.agent@gmail.com>","list_archive_url":null,"date":"2026-04-29T15:18:34","subject":"Re: [LTP] close02: add test for double close EBADF","submitter":{"id":93132,"url":"http://patchwork.ozlabs.org/api/people/93132/","name":null,"email":"linuxtestproject.agent@gmail.com"},"content":"Hi Jinseok,\n\nOn 2026-04-29, Jinseok Kim wrote:\n> close02: add test for double close EBADF\n\n> +static void setup(void)\n> +{\n> +\tfd_closed = SAFE_OPEN(\"close02\", O_CREAT | O_RDWR, 0600);\n> +\tSAFE_CLOSE(fd_closed);\n> +}\n\nSAFE_CLOSE(fd_closed) resets fd_closed to -1 (the macro does `fd = -1`\nafter the close), so both test cases end up calling close(-1). The second\ncase never exercises the double-close path. Use a local variable to\npreserve the fd value:\n\n    int fd = SAFE_OPEN(\"close02\", O_CREAT | O_RDWR, 0600);\n    fd_closed = fd;\n    SAFE_CLOSE(fd);\n\n---\nNote:\n\nOur agent completed the review of the patch.\n\nThe agent can sometimes produce false positives although often its\nfindings are genuine. If you find issues with the review, please\ncomment this email or ignore the suggestions.\n\nRegards,\nLTP AI Reviewer","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=20251104 header.b=rx5Tlwnx;\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 4g5LYJ5tc4z1yHX\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 01:18:44 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 4494A3E49C0\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 17:18:42 +0200 (CEST)","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 2F7653C66CA\n for <ltp@lists.linux.it>; Wed, 29 Apr 2026 17:18:37 +0200 (CEST)","from mail-qk1-x744.google.com (mail-qk1-x744.google.com\n [IPv6:2607:f8b0:4864:20::744])\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 8BE251400C7B\n for <ltp@lists.linux.it>; Wed, 29 Apr 2026 17:18:36 +0200 (CEST)","by mail-qk1-x744.google.com with SMTP id\n af79cd13be357-8d4f78fc9f6so1375887085a.3\n for <ltp@lists.linux.it>; Wed, 29 Apr 2026 08:18:36 -0700 (PDT)","from\n runnervmeorf1.huximawhmwiu1p2xc5qsgb550a.bx.internal.cloudapp.net\n ([172.203.253.214]) by smtp.gmail.com with ESMTPSA id\n af79cd13be357-8f940536e87sm198344785a.45.2026.04.29.08.18.34\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 29 Apr 2026 08:18:34 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777475915; x=1778080715; darn=lists.linux.it;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=sI3T+tOdHYSfX/QLc1kI372D5l6V38DZKOH5QmUQk5Q=;\n b=rx5Tlwnx4d0plptJ3Qz85btNf+zp5Seyp3KrWosyEA7RRBNQn1oqERHy6KOcaskeEp\n me8kTbUKhraLwz6OPjAas56m+8nVIL1zi5Q4R7DzxRGsCwOlAp/IZWFhXPbJrKxMJwa1\n UK0ynOFRhUTXny2ou5uQ9bNyJXgHmxNhoCxWm/zwgmbtbwp9oqgQ5Raidn5OXp9SG3cL\n uSLENxcZ/hkg9w4gqA+9IxUzlL6NEeicWNj6gyUtsoODfdXCgAq9nT9DlMNMrW7GtKU1\n fBolPbRU7LAak9s9FvOZeyYScW8z+LJtxgMR00V+n3uLJqY4gTapYxbYX+pH3f8xLefk\n Lb/A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777475915; x=1778080715;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=sI3T+tOdHYSfX/QLc1kI372D5l6V38DZKOH5QmUQk5Q=;\n b=E4nX4uxWYaTpjXGuF3pZEgquEYrPJH5zdtnvmfgnfVohw/CvVAqzYX0Opa4n2S3E7B\n 1AACXuwpIdNyWXQKmxsqknkNVst03J8ncaic9TBGcZfZJI9+rZCLYebZKhvovh/ts3A9\n DmBQvFliME+BHG/JaAADmysx4iMNcn102ErXTaj902hV3dNbnfKryYkvUZDRGlmZZc7u\n QlidodDM658jf0tjwKTLUkdk2wt/wUYiKCShnpwCSdTR0OlvmPXisUReQcKNYCDg/D//\n H130WOgc746NxgqluWI4aoiagHM85zhN4YROo7LriZjtvcLpaEAVnPbuDUtK7QsC1VKB\n a1xQ==","X-Gm-Message-State":"AOJu0YynR7lssyM0SZH3GlkBrzzqi1q3xamhV9O2hqNAkaMUsnBqbjxp\n ST88xS8onXGjL16Rf5BWEALR1ujazfibeIHHkKoaB4bI7tfSJSQqMRzl","X-Gm-Gg":"AeBDiet9Lkc3Lhlzh3/II7++NAAcCqPdMqot9W1QZuFg085oC0/NuSa5ICRT1yWw/+i\n HMOaUIxHWAi9nB6wuj7793K9Nv9577c6bY2zbUm+a9sJ8h9zVk8x5NEPMtjCQnGL4Czd1O37tzf\n Rb0atZ1VPfj4RgquCgjrmyY0pVzil5Sao31D9oHgqsssnlzmIuQA0KWT2M2OMhVAK+ZeE/h3Xde\n xjrxy+IZqSbLnRvPfmE4j7h9Iq3p8zuivqZfw0VUz9ffU4CQKfvWyhLyNb2oCbBtmCOWBzm7qaS\n NoALaIawxswkvlSwaV4Y3CMROAjbaHpce66M0ZEAqVrPF+1N5OMr8OEzzL98O0SsRzx6+Vc9EV5\n l7jJQHE8XbfLGRut8XuPdrZIHvbuQEcju/T89oj3eQS4BvlNFTACWxAj8U2IumCpvGZi6Zc2yts\n 7sQ1XIUTC944Sn674kbN5JNXL5vtr/aaKUNWpu7YrECZgd4V8qgLBvER+AGVByEy9sMCQWmLpNd\n SHseUrTEFVRHq+BR28/AahNGz2rgyysufDG2c9ht+K8hGLT7k3X","X-Received":"by 2002:a05:620a:28d6:b0:8ef:dcb7:59a5 with SMTP id\n af79cd13be357-8f7d920262bmr1088037285a.30.1777475915058;\n Wed, 29 Apr 2026 08:18:35 -0700 (PDT)","From":"linuxtestproject.agent@gmail.com","To":"Jinseok Kim <always.starving0@gmail.com>","Date":"Wed, 29 Apr 2026 15:18:34 +0000","Message-ID":"<20260429151834.3982-1-linuxtestproject.agent@gmail.com>","X-Mailer":"git-send-email 2.54.0","In-Reply-To":"<20260429142016.1483-1-always.starving0@gmail.com>","References":"<20260429142016.1483-1-always.starving0@gmail.com>","MIME-Version":"1.0","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS\n 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":"Re: [LTP] close02: add test for double close EBADF","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>","Cc":"ltp@lists.linux.it","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>"}}]