From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Manning Subject: Is naked reading of inode->i_size OK? Date: Wed, 10 Oct 2007 12:40:08 +1300 Message-ID: <200710101240.08069.manningc2@actrix.gen.nz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-fsdevel@vger.kernel.org Return-path: Received: from smtp.scorch.co.nz ([203.167.210.162]:39392 "HELO firstline.co.nz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1751138AbXJIXsg (ORCPT ); Tue, 9 Oct 2007 19:48:36 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Reading through 2.6.23's vmtruncate() [mm/memory.c], I notice that vmtruncate reads inode->i_size directly and not through the i_size_read() wrapper. Is that OK? Lower down the same function calls i_size_write() and the calling chain calls i_size_read() so why is i_size_read() not being used here? int vmtruncate(struct inode * inode, loff_t offset) { struct address_space *mapping = inode->i_mapping; unsigned long limit; if (inode->i_size < offset) goto do_expand; ... }