EXT3: problem with copy_from_user inside a transaction

From: Andrey Savochkin
Date: Fri Sep 03 2004 - 06:07:35 EST


Hi Andrew,

filemap_copy_from_user() between prepare_write() and commit_write()
appears to be a problem for ext3.

prepare_write() starts a transaction, and if filemap_copy_from_user() causes
a page fault, we'll have
- order violation with mmap_sem taken inside a transaction (possible
deadlocks),
- __GFP_FS memory allocation with all re-entrancy problems (e.g.,
current->journal_info corruption).

Am I missing something?

If this observation is correct, the possible solution is to call
get_user_pages() or somehow pin the user pages before prepare_write(),
although it will hurt performance...

Andrey
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/