From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: [PATCH 08/19] fs: Skip atime update on frozen filesystem Date: Thu, 29 Mar 2012 01:43:23 +0200 Message-ID: <1332978214-15535-9-git-send-email-jack@suse.cz> References: <1332978214-15535-1-git-send-email-jack@suse.cz> Cc: Al Viro , dchinner@redhat.com, sandeen@redhat.com, Kamal Mostafa , Jan Kara To: linux-fsdevel@vger.kernel.org Return-path: Received: from cantor2.suse.de ([195.135.220.15]:58633 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933369Ab2C1XoL (ORCPT ); Wed, 28 Mar 2012 19:44:11 -0400 In-Reply-To: <1332978214-15535-1-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: It is unexpected to block reading of frozen filesystem because of atime update. Also handling blocking on frozen filesystem because of atime update would make locking more complex than it already is. So just skip atime update when filesystem is frozen like we skip it when filesystem is remounted read-only. BugLink: https://bugs.launchpad.net/bugs/897421 Tested-by: Kamal Mostafa Tested-by: Peter M. Petrakis Tested-by: Dann Frazier Tested-by: Massimo Morana Signed-off-by: Jan Kara --- fs/inode.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 095828c..ff3b385 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1535,12 +1535,17 @@ void touch_atime(struct vfsmount *mnt, struct dentry *dentry) if (timespec_equal(&inode->i_atime, &now)) return; - if (mnt_want_write(mnt)) + if (!sb_start_write_trylock(inode->i_sb)) return; + if (__mnt_want_write(mnt)) + goto skip_update; + inode->i_atime = now; mark_inode_dirty_sync(inode); - mnt_drop_write(mnt); + __mnt_drop_write(mnt); +skip_update: + sb_end_write(inode->i_sb); } EXPORT_SYMBOL(touch_atime); -- 1.7.1