[PATCH] remove NULL pointers from vfs_ops struct

Esh, Andrew Andrew_Esh at adaptec.com
Mon May 12 15:26:39 GMT 2003


I had issues with this code a while back, where someone managed to call the
null pointer in a VFS module. I submitted a patch that fixed the specific
problem. This fix appears to me to address all of those issues, and has the
added value of removing a lot of null pointer testing code that I was
interested in removing. This is a more correct fix.

To codify what we've learned: It seems to me that there should be a policy
that the function pointers in the ops structure should never be null.
Perhaps an assert could enforce this. A VFS module should always do one of
the following with each function:

1. Override the function with a valid function.
2. Override the function with a non-operational function which returns a
correct error value.
3. Not override the function, leaving the default function in place.

In cases 1 & 2, if those functions do not handle the call, they should call
the default function, which must also not be null.

-----Original Message-----
From: Stefan (metze) Metzmacher [mailto:metze at metzemix.de]
Sent: Monday, May 12, 2003 9:38 AM
To: Alexander Bokovoy
Cc: samba-technical at lists.samba.org
Subject: [PATCH] remove NULL pointers from vfs_ops struct


Hi Alexander,

here's the patch that removes the NULL pointers as valid function pointer 
from the vfs_ops struct
when HAVE_NO_ACL is defined.

Please check if the patch is ok...


metze
----------------------------------------------------------------------------
-
Stefan "metze" Metzmacher <metze at metzemix.de> 


More information about the samba-technical mailing list