On Sat, Jul 23, 2011 at 04:29:44AM +0100, Al Viro wrote: > OK, unless there are serious objections, I > * apply Linus' patch as-is > * fix that ocfs2 leak > * replace posix_acl_..._masq() with saner helpers (take original > acl + other arguments, return modified clone or ERR_PTR) and kill open-coded > instances... Done (along with 9p leak fixes). NOTE: this is completely untested. posix_acl_clone()/posix_acl_create_masq()/posix_acl_chmod_masq() all became static in fs/posix_acl.c; replacement functions are posix_acl_create() and posix_acl_chmod(). All callers converted, with about a hundred lines of boilerplates gone. And yes, it's pure copy-on-write. The objects are refcounted, shared a lot and the only primitives that did modifications had been *too* primitive - their callers all started with creating a copy, then modifying it, then letting somebody see the result. Conclusion: that's an obvious free-by-RCU fodder. I have not done that yet, but it should be trivial to add. posix_acl_release() would, instead of kfree(), do kfree_rcu() (and we'd need to add rcu_head to struct posix_acl). I'm not sure if merging the copying into ..._masq() would be worth doing. posix_acl_clone() is basically kmemdup() and ..._masq() is a loop over all array elements, with switch by element tag, modifying some of them. Might be worth merging with copying the elements... Hell knows. Anyway, that'll have to wait for tomorrow; I'm going down right now. This stuff (plus Tim's "mount lock scalability for internal mounts" patch) is in #untested in usual place. Comments/testing/etc. are welcome... -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html