From: Suparna Bhattacharya mm/filemap.c | 13 +++++++++++++ 1 files changed, 13 insertions(+) diff -puN mm/filemap.c~O_DIRECT-race-fixes-commentary mm/filemap.c --- 25/mm/filemap.c~O_DIRECT-race-fixes-commentary 2003-09-10 21:48:32.000000000 -0700 +++ 25-akpm/mm/filemap.c 2003-09-10 21:48:32.000000000 -0700 @@ -1754,6 +1754,9 @@ EXPORT_SYMBOL(generic_write_checks); /* * Write to a file through the page cache. + * Should be called with the following semaphores already held: + * i_alloc_sem (only for O_DIRECT writes to regular files) + * i_sem (only for regular files) * * We put everything into the page cache prior to writing it. This is not a * problem when writing full pages. With partial pages, however, we first have @@ -1967,6 +1970,11 @@ out: return err; } +/* + * Should be called with the following semaphores already held: + * i_alloc_sem (only for O_DIRECT writes to regular files) + * i_sem (only for regular files) + */ ssize_t generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t *ppos) @@ -2016,6 +2024,11 @@ __generic_file_write_nolock(struct file return ret; } +/* + * Should be called with the following semaphores already held: + * i_alloc_sem (only for O_DIRECT writes to regular files) + * i_sem (only for regular files) + */ ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov, unsigned long nr_segs, loff_t *ppos) _