aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2012-06-12 10:20:36 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-31 01:45:38 -0400
commit5d37e9e6dec65cd21be68ee92de99686213e916b (patch)
tree8d52a542cdd917053e3c8ad71d7529887a39d9c5 /fs/inode.c
parenteb04c28288bb0098d0e75d81ba2a575239de71d8 (diff)
fs: Skip atime update on frozen filesystem
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 <kamal@canonical.com> Tested-by: Peter M. Petrakis <peter.petrakis@canonical.com> Tested-by: Dann Frazier <dann.frazier@canonical.com> Tested-by: Massimo Morana <massimo.morana@canonical.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 006c85ca06eb..74d7c20fac88 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1542,9 +1542,11 @@ void touch_atime(struct path *path)
1542 if (timespec_equal(&inode->i_atime, &now)) 1542 if (timespec_equal(&inode->i_atime, &now))
1543 return; 1543 return;
1544 1544
1545 if (mnt_want_write(mnt)) 1545 if (!sb_start_write_trylock(inode->i_sb))
1546 return; 1546 return;
1547 1547
1548 if (__mnt_want_write(mnt))
1549 goto skip_update;
1548 /* 1550 /*
1549 * File systems can error out when updating inodes if they need to 1551 * File systems can error out when updating inodes if they need to
1550 * allocate new space to modify an inode (such is the case for 1552 * allocate new space to modify an inode (such is the case for
@@ -1553,7 +1555,9 @@ void touch_atime(struct path *path)
1553 * so just ignore the return value. 1555 * so just ignore the return value.
1554 */ 1556 */
1555 update_time(inode, &now, S_ATIME); 1557 update_time(inode, &now, S_ATIME);
1556 mnt_drop_write(mnt); 1558 __mnt_drop_write(mnt);
1559skip_update:
1560 sb_end_write(inode->i_sb);
1557} 1561}
1558EXPORT_SYMBOL(touch_atime); 1562EXPORT_SYMBOL(touch_atime);
1559 1563