From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Koss Subject: Re: truncate implementation Date: Tue, 17 Jan 2006 12:21:25 +0300 Message-ID: References: <1137486696.3005.15.camel@laptopd505.fenrus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Cc: kernelnewbies@nl.linux.org, linux-fsdevel@vger.kernel.org Return-path: Received: from uproxy.gmail.com ([66.249.92.204]:49013 "EHLO uproxy.gmail.com") by vger.kernel.org with ESMTP id S932370AbWAQJV2 convert rfc822-to-8bit (ORCPT ); Tue, 17 Jan 2006 04:21:28 -0500 Received: by uproxy.gmail.com with SMTP id s2so987609uge for ; Tue, 17 Jan 2006 01:21:25 -0800 (PST) To: arjan@infradead.org In-Reply-To: <1137486696.3005.15.camel@laptopd505.fenrus.org> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Thanks for reply. > .. which isn't in the pagetable, and then the kernel notices it's > outside the file and causes a SIGBUS. But if length of file after truncate is 4 byte, for example, and I do p[5]=.., this didn't cause any error, so I can append some garbage after end of file, and this is not error? > > .. and removes the page from the pagetable. > I'm sorry for stupid question, but where we remove from pagetable, I see two places in ext2_truncate: block_truncate_page and sync_mapping_buffers but sync_mapping_buffer called only if inode_needs_sync(inode), so p=mmap and reading file using p cause setting of "inode_need_sync" flag?