On Fri, Nov 8, 2013 at 11:43 AM, Roland Mainz <[email protected]> wrote:
> On Fri, Nov 8, 2013 at 10:38 AM, Joshuah Hurst <[email protected]> wrote:
>> On Thu, Nov 7, 2013 at 6:04 PM, Glenn Fowler <[email protected]>
>> wrote:
>>> thanks for the detailed report
>>> the ast::pathdev() function has a few compile-time code paths on
>>> defined(O_XATTR)
>>> the one with defined(O_XATTR)!=0 but fails on a particular fs is the least
>>> exercised
>>> I think this patch will resolve it but I'm not sure about consequences
>>> w.r.t. other callers
>>> unfortunately for the near-term I only have build access to my home suse
>>> machine with defined(O_XATTR)==0
>>> so we'll have to rely on the community to test
>>
>> The patch does not work. I am still getting No such file or directory
>> instead of Invalid value and the extra openat(10,
>> "/dev/file/xattr@/devices//@//") call still happens:
>>
>> openat(10, "/devices", O_RDONLY|O_NONBLOCK) = 3
>> fstat(3, 0xFFFFFD7FFFDFE3E0) = 0
>> fcntl(3, F_SETFD, 0x00000001) = 0
>> openat(3, ".", O_RDONLY|O_NONBLOCK|O_XATTR) Err#22 EINVAL
>> close(3) = 0
>> openat(10, "/dev/file/xattr@/devices//@//", O_RDONLY|O_NONBLOCK) Err#2 ENOENT
>> open("/usr/lib/locale/en_US.UTF-8/LC_MESSAGES/SUNW_OST_OSLIB.mo",
>> O_RDONLY) Err#2 ENOENT
>> ./arch/sol11.i386-64/bin/ksh: cd: /dev/file/xattr@/devices//@//: [No
>> such file or directory]
>> write(2, " . / a r c h / s o l 1 1".., 93) = 93
>
> Erm... Glenn's patch is OK so far... but there is a 2nd issue... if
> |pathdev()| fails the error is ignored and the real path is passed to
> |openat()| again...
Attached (as "astksh20131010_xattr_solaris_fswithoutxattr001.diff.txt")
is a patch which fixes the issues...
... Glenn: Is the patch OK for you ?
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) [email protected]
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
diff -r -u build_i386_64bit_debug/src/lib/libast/path/pathcanon.c
build_gsffix/src/lib/libast/path/pathcanon.c
--- src/lib/libast/path/pathcanon.c 2013-09-27 11:17:46.000000000 +0200
+++ src/lib/libast/path/pathcanon.c 2013-11-08 11:52:31.315746992 +0100
@@ -535,9 +535,12 @@
r = 0;
else if ((n = openat(dev->fd, ".",
O_INTERCEPT|O_RDONLY|O_XATTR|O_NONBLOCK)) < 0)
{
+ int saved_errno = errno;
r = 0;
close(dev->fd);
dev->fd = -1;
+ errno = saved_errno;
+ return 0;
}
else
{
diff -r -u build_i386_64bit_debug/src/lib/libast/path/pathopen.c
build_gsffix/src/lib/libast/path/pathopen.c
--- src/lib/libast/path/pathopen.c 2013-09-27 11:17:46.000000000 +0200
+++ src/lib/libast/path/pathopen.c 2013-11-08 11:40:07.824442260 +0100
@@ -168,7 +168,9 @@
b = canon ? canon : (char*)path;
if (!pathdev(dfd, path, canon, size, flags, &dev))
- b = (char*)path;
+ {
+ return -1;
+ }
else if (dev.path.offset)
{
oerrno = errno;
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers