[Ocfs2-devel] [PATCH] ocfs2: avoid direct write if we fall back to buffered
Joel Becker
Joel.Becker at oracle.com
Tue Apr 13 18:58:19 PDT 2010
On Thu, Apr 08, 2010 at 03:47:24PM +0800, Li Dongyang wrote:
> when we fall back to buffered write from direct write, we call
> __generic_file_aio_write but that will end up doing direct write
> even we are only prepared to do buffered write because the file
> has O_DIRECT flag set. This is a fix for
> https://bugzilla.novell.com/show_bug.cgi?id=591039
We need to evaluate what __g_f_a_w() is doing and make sure
we're matching it appropriately for ocfs2.
> + ret = file_remove_suid(file);
> + if (ret)
> + goto out_dio;
NAK. We do suid checks in ocfs2_prepare_inode_for_write().
Calling file_remove_suid() is outside of ocfs2's locking. It calls
->setattr() which has its own rules in ocfs2.
> + file_update_time(file);
We have special behaviors regarding time updates for ocfs2
direct I/O. This might want to live right next to the call to
generic_file_buffered_write(). But maybe not. It needs to be checked.
Joel
--
To spot the expert, pick the one who predicts the job will take the
longest and cost the most.
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
More information about the Ocfs2-devel
mailing list