On Thu, 7 Dec 2000, Szabolcs Szakacsits wrote:
> Read the whole get_empty_filp function, especially this part, note the
> goto new_one below and the part you didn't include above [from
> the new_one label],
> 
>         if (files_stat.nr_files < files_stat.max_files) {
>                 file_list_unlock();
>                 f = kmem_cache_alloc(filp_cachep, SLAB_KERNEL);
>                 file_list_lock();
>                 if (f) {
>                         files_stat.nr_files++;
>                         goto new_one;
>                 }

I have read the whole function, including the above code, of course. The
new_one label has nothing to do with freelists -- it adds the file to the
anon_list, where the new arrivales from the slab cache go. The goto
new_one above is there simply to initialize the structure with sane
initial values

So, the normal user _cannot_ take a file structure from the freelist
unless it contains more than NR_RESERVED_FILE entries. Please read the
whole function and see it for yourself.

Regards,
Tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to