User: Password:
|
|
Subscribe / Log in / New account

Incomplete patch?

Incomplete patch?

Posted Mar 23, 2007 9:56 UTC (Fri) by khim (subscriber, #9252)
In reply to: Incomplete patch? by ldo
Parent article: fallocate()

I can't see any code for initializing this field to any value

Have you looked at GCC sources ? That's where this code is, after all...

P.S. Hint: what does C standard says about initialization of static and globar structures ?


(Log in to post comments)

Incomplete patch?

Posted Mar 23, 2007 20:46 UTC (Fri) by giraffedata (subscriber, #1954) [Link]

Have you looked at GCC sources ? That's where this code is, after all...

No, it's not. It's in the filesystem drivers, in the statement that declares the inode_operations variables. Looking to GCC source code for the setting of this member to NULL is like looking at at GCC source code to see the setting of 'a' to 7 in a program that contains the line "int a = 7;"

Hint: what does C standard says about initialization of static and globar structures ?

An even better hint is that all the filesystem drivers (I hope) initialize the inode operations field by assigning from a static constant inode_operations variable. Because that's not obvious, and is essential to this patch working.

Incomplete patch?

Posted Mar 26, 2007 17:44 UTC (Mon) by shishir (subscriber, #20844) [Link]

i guess this might be a case where we assume that if a filesystem does not explicitly initialise the field, it is NULL, as the system call code does check for this field to be non-NULL. If it is NULL, it returns -ENOSYS. So, I guess, you are right in saying that there are certain per-filesystem patches that need to be installed.

Incomplete patch?

Posted Mar 27, 2007 15:50 UTC (Tue) by giraffedata (subscriber, #1954) [Link]

I guess this might be a case where we assume that if a filesystem does not explicitly initialise the field, it is NULL, as the system call code does check for this field to be non-NULL. If it is NULL, it returns ->ENOSYS. So, I guess, you are right in saying that there are certain per-filesystem patches that need to be installed.
So you're saying that the assumption that if a filesystem driver does not explicitly initialize the field, it is NULL, is wrong? What makes you think that?


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds