From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Fasheh Subject: i_mutex locking in generic_file_splice_write() Date: Thu, 12 Oct 2006 12:01:52 -0700 Message-ID: <20061012190152.GU6485@ca-server1.us.oracle.com> Reply-To: Mark Fasheh Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , Jens Axboe Return-path: Received: from rgminet01.oracle.com ([148.87.113.118]:2798 "EHLO rgminet01.oracle.com") by vger.kernel.org with ESMTP id S1751152AbWJLTCP (ORCPT ); Thu, 12 Oct 2006 15:02:15 -0400 To: linux-fsdevel@vger.kernel.org Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi, generic_file_splice_write() will call into a file systems ->prepare_write() and ->commit_write() via the the pipe_to_file() actor. pipe_to_file() is careful to take the pipe inode i_mutex, but nowhere in the call path do I see i_mutex on the inode being written to taken. Shouldn't we be taking this before calling into ->prepare_write() and ->commit_write(). What's preventing generic_file_splice_write() from racing a truncate? Or maybe even another write? A quick look through other callers reveals that generic_file_aio_write() and do_lo_send_aops() both are careful to take i_mutex. Thanks, --Mark -- Mark Fasheh Senior Software Developer, Oracle mark.fasheh@oracle.com