Re: [PATCH v2 16/20] efivarfs: Return an error if we fail to read a variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2012-12-21 at 15:08 +0800, Lingzhu Xiang wrote:
> 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

Yeah, this file shouldn't exist. I'm working on a patch. Thanks!

-- 
Matt Fleming, Intel Open Source Technology Center

--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux