From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lingzhu Xiang Subject: Re: [PATCH v2 16/20] efivarfs: Return an error if we fail to read a variable Date: Fri, 21 Dec 2012 15:08:15 +0800 Message-ID: <50D40ADF.4050700@redhat.com> References: <1351237923-10313-1-git-send-email-matt@console-pimps.org> <1351237923-10313-17-git-send-email-matt@console-pimps.org> <1351846434.14888.157.camel@mfleming-mobl1.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1351846434.14888.157.camel-ZqTwcBeJ+wsBof6jY8KHXm7IUlhRatedral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Matt Fleming Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Matthew Garrett , Jeremy Kerr , Andy Whitcroft , Chun-Yi Lee , Alan Cox , Josh Boyer List-Id: linux-efi@vger.kernel.org On 11/02/2012 04:53 PM, Matt Fleming wrote: > Instead of always returning 0 in efivarfs_file_read(), even when we > fail to successfully read the variable, convert the EFI status to > something meaningful and return that to the caller. This way the user > will have some hint as to why the read failed. > ... > > + case EFI_NOT_FOUND: > + err = -ENOENT; This will be ambiguous for userspace. Is it file not being found by efivarfs or by firmware? Actually I've been confused during testing like this: # ll test-12341234-1234-1234-1234-123412341234 ls: cannot access test-12341234-1234-1234-1234-123412341234: No such file or directory # echo -en "\0\0\0\0a" >test-12341234-1234-1234-1234-123412341234 -bash: echo: write error: No such file or directory # ll test-12341234-1234-1234-1234-123412341234 -rw-r--r--. 1 root root 0 Dec 21 06:19 test-12341234-1234-1234-1234-123412341234 -- Lingzhu Xiang