From nobody Mon Feb 9 18:18:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1571222452; cv=none; d=zoho.com; s=zohoarc; b=Doz6N8aU7PCzwhwqUNHZ6XVBqqBjAuZh18QiP7UNiBxPKKLLjSXnupor4ZJYkiki7T04z+9Oc0YOhg/VQqsWph18X+QdEUpKEJc5V6JljqxcQZwWqJ1XYaIqFxUCXCVumekkhFTDroy6nGQzZgwQTwK1HOQEmyTfCGFy2VU8TsE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571222452; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ahgLQwgUDmHWO3TkVhUZZNOL5Eay9Zwe18HW8wgcbTI=; b=K4P+Yht8cFtHzVkQJmNWnjatDBKSRtc3hD1nb2BMA8FVoUvOk0ZUQOjC4GzVD6IHMCNX2YO84pX7M8tFs4NnMHg5hEl47pxGXZJuDNI7ucjqQ1KbkW6qnK+/18fuGdVIY7KVrBhiR+Uu7mH/cRWiJlEG6wecqXNBXHb3i2+SRQw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571222452924545.8010200627815; Wed, 16 Oct 2019 03:40:52 -0700 (PDT) Received: from localhost ([::1]:40732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKgjb-0004H8-TG for importer@patchew.org; Wed, 16 Oct 2019 06:40:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35979) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKga8-0006Rh-VM for qemu-devel@nongnu.org; Wed, 16 Oct 2019 06:31:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iKga4-0006G4-3h for qemu-devel@nongnu.org; Wed, 16 Oct 2019 06:31:04 -0400 Received: from mgwkm02.jp.fujitsu.com ([202.219.69.169]:46960) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iKga2-0006FM-Aj for qemu-devel@nongnu.org; Wed, 16 Oct 2019 06:30:59 -0400 Received: from kw-mxauth.gw.nic.fujitsu.com (unknown [192.168.231.132]) by mgwkm02.jp.fujitsu.com with smtp id 3866_5ffe_eb1f6e5b_66f1_425e_b0c7_02822bc8ecff; Wed, 16 Oct 2019 19:30:50 +0900 Received: from g01jpfmpwkw01.exch.g01.fujitsu.local (g01jpfmpwkw01.exch.g01.fujitsu.local [10.0.193.38]) by kw-mxauth.gw.nic.fujitsu.com (Postfix) with ESMTP id 28D09AC00D2 for ; Wed, 16 Oct 2019 19:30:49 +0900 (JST) Received: from G01JPEXCHKW17.g01.fujitsu.local (G01JPEXCHKW17.g01.fujitsu.local [10.0.194.56]) by g01jpfmpwkw01.exch.g01.fujitsu.local (Postfix) with ESMTP id 3692E6925C7; Wed, 16 Oct 2019 19:30:48 +0900 (JST) Received: from luna3.soft.fujitsu.com (10.124.196.199) by G01JPEXCHKW17.g01.fujitsu.local (10.0.194.56) with Microsoft SMTP Server id 14.3.439.0; Wed, 16 Oct 2019 19:30:48 +0900 From: Misono Tomohiro To: Subject: [PATCH 1/2] virtiofsd: Avoid process hang when doing xattr operation to FIFO Date: Wed, 16 Oct 2019 19:37:53 +0900 Message-ID: <20191016103754.2047-2-misono.tomohiro@jp.fujitsu.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191016103754.2047-1-misono.tomohiro@jp.fujitsu.com> References: <20191016103754.2047-1-misono.tomohiro@jp.fujitsu.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SecurityPolicyCheck-GC: OK by FENCE-Mail X-TM-AS-GCONF: 00 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.219.69.169 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, misono.tomohiro@jp.fujitsu.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" I see xfstest generic/062 causes process hang because of xattr operation to FIFO created by mknod. The problem is that virtiofsd opens any files with only O_RDWR or O_RDONLY flags for xattr operation, and therefore if a file is FIFO, open may not return. Since O_NONBLOCK flag has no effect to regular files, add it to open flags to fix the problem. Signed-off-by: Misono Tomohiro --- contrib/virtiofsd/passthrough_ll.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/virtiofsd/passthrough_ll.c b/contrib/virtiofsd/passthr= ough_ll.c index 84b60d85bd..645324da58 100644 --- a/contrib/virtiofsd/passthrough_ll.c +++ b/contrib/virtiofsd/passthrough_ll.c @@ -2251,7 +2251,7 @@ static void lo_getxattr(fuse_req_t req, fuse_ino_t in= o, const char *name, } =20 sprintf(procname, "%i", inode->fd); - fd =3D openat(lo->proc_self_fd, procname, O_RDONLY); + fd =3D openat(lo->proc_self_fd, procname, O_RDONLY|O_NONBLOCK); if (fd < 0) { goto out_err; } @@ -2323,7 +2323,7 @@ static void lo_listxattr(fuse_req_t req, fuse_ino_t i= no, size_t size) } =20 sprintf(procname, "%i", inode->fd); - fd =3D openat(lo->proc_self_fd, procname, O_RDONLY); + fd =3D openat(lo->proc_self_fd, procname, O_RDONLY|O_NONBLOCK); if (fd < 0) { goto out_err; } @@ -2397,7 +2397,7 @@ static void lo_setxattr(fuse_req_t req, fuse_ino_t in= o, const char *name, } =20 sprintf(procname, "%i", inode->fd); - fd =3D openat(lo->proc_self_fd, procname, O_RDWR); + fd =3D openat(lo->proc_self_fd, procname, O_RDWR|O_NONBLOCK); if (fd < 0) { saverr =3D errno; goto out; @@ -2446,7 +2446,7 @@ static void lo_removexattr(fuse_req_t req, fuse_ino_t= ino, const char *name) } =20 sprintf(procname, "%i", inode->fd); - fd =3D openat(lo->proc_self_fd, procname, O_RDWR); + fd =3D openat(lo->proc_self_fd, procname, O_RDWR|O_NONBLOCK); if (fd < 0) { saverr =3D errno; goto out; --=20 2.21.0