Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2836606imm; Sun, 29 Jul 2018 04:39:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf39IjJkbe2alM7VogX4To7a9Dr3jODgctzn3/Nolxi1J1rPU9GJ2I91gILdS3vz5gsnLLo X-Received: by 2002:a63:3d41:: with SMTP id k62-v6mr12577155pga.254.1532864340596; Sun, 29 Jul 2018 04:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532864340; cv=none; d=google.com; s=arc-20160816; b=Bkwplr2XL1SDPkQbkr96atqFSeWUrVpo7wZyrO3EpIi8WvDMLLwDW+V1PsXW4VkPJ8 jSrFCfnG0mx448pPzbVeHoFDQnPB36xM9FN4aVriH0Z3fXfvaYLnj+eBPnu7bJbiX6No hUIR80IvlUbjSYLvXuIFup2pXb1DoM9UxZJPEqnDkDHwstR5VqI7PjHEXYaOcZBKqAZN n1hyAbUXFmwooP/6/lOKMWz2wMoe8pdY4p1vxUdXrCtPGk0vUZ6au20UAj1RZa/mLAMl d34zVuCKe1+gTRbp+A2DSFOfVWgyfNnz4Pey//NUmHaPwK8cJJop+mnOO7ha+9qUluUK 1dEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=AeodB+iMZ64mTIJ+OTFItrZKosRe3SgiUQGPCABMJNY=; b=JklaouWFnORxIA1lnwiJI5mFDTbGM+QuQk+NgjJlEcvzfgOGXDXHvScX56ElnnbPi0 9FNLrf0LyhFw27ctMsj4Qj/CHkOCsNgxRJ+SpEdmnJxCMLacFpWCrhfeWUQ0lM9TC3BI d76jTBnZkGjHgCYY4LkfyQGyjA7+Yyjqz9dH1DcKeZdY0MScWWkGbs7XuJz5CwDbnTu6 lKn7yMrBhv5aRDVZ1st+OeDl5Ag3zLCXkDTLC0osP3FNWu9kK5uM41pTnBhuV96E9pFY QlcHlXswPihddjgP88U4rlTLViZ+ebdgY42qgN8UgDTR0L24GFQ28beRqaU5tcBqyVw5 +3OA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s24-v6si7760340plq.358.2018.07.29.04.38.44; Sun, 29 Jul 2018 04:39:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726335AbeG2NIB (ORCPT + 99 others); Sun, 29 Jul 2018 09:08:01 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:51803 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbeG2NIB (ORCPT ); Sun, 29 Jul 2018 09:08:01 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 642EC80646; Sun, 29 Jul 2018 13:37:50 +0200 (CEST) Date: Sun, 29 Jul 2018 13:37:49 +0200 From: Pavel Machek To: David Howells Cc: viro@zeniv.linux.org.uk, torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 36/38] vfs: Add a sample program for the new mount API [ver #10] Message-ID: <20180729113749.GA7333@amd> References: <153271267980.9458.7640156373438016898.stgit@warthog.procyon.org.uk> <153271292330.9458.14583488053811372222.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SUOF0GtieIMvvwua" Content-Disposition: inline In-Reply-To: <153271292330.9458.14583488053811372222.stgit@warthog.procyon.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > Add a sample program to demonstrate fsopen/fsmount/move_mount to mount > something. > @@ -0,0 +1,118 @@ > +/* fd-based mount test. > + * > + * Copyright (C) 2017 Red Hat, Inc. All Rights Reserved. > + * Written by David Howells (dhowells@redhat.com) > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public Licence > + * as published by the Free Software Foundation; either version > + * 2 of the Licence, or (at your option) any later version. > + */ Can we do SPDX here? > +static void check_messages(int fd) > +{ > + char buf[4096]; > + int err, n; > + > + err =3D errno; > + > + for (;;) { > + n =3D read(fd, buf, sizeof(buf)); > + if (n < 0) > + break; > + n -=3D 2; > + > + switch (buf[0]) { > + case 'e': > + fprintf(stderr, "Error: %*.*s\n", n, n, buf + 2); > + break; > + case 'w': > + fprintf(stderr, "Warning: %*.*s\n", n, n, buf + 2); > + break; > + case 'i': > + fprintf(stderr, "Info: %*.*s\n", n, n, buf + 2); > + break; > + } > + } Hmm, so kernel now returns messages in english? Not sure that is reasonable, as that is going to cause problems with translations... Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --SUOF0GtieIMvvwua Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAltdpw0ACgkQMOfwapXb+vJVPQCfTdFl0Cg4welkfP0BroZo+10H ipEAnA2qnvw/D+ipZkAGPHJU8lECpTM1 =IODW -----END PGP SIGNATURE----- --SUOF0GtieIMvvwua--