From 3a715a5002e73d34fd9e21001616f2d85d267b3a Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Tue, 12 Jun 2012 16:20:36 +0200 Subject: [PATCH] --- yaml --- r: 320985 b: refs/heads/master c: 5d37e9e6dec65cd21be68ee92de99686213e916b h: refs/heads/master i: 320983: ad2be6854c06c817e5c7fefa80c597dc43efa152 v: v3 --- [refs] | 2 +- trunk/fs/inode.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 11e7cd893723..f753f789fe7c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eb04c28288bb0098d0e75d81ba2a575239de71d8 +refs/heads/master: 5d37e9e6dec65cd21be68ee92de99686213e916b diff --git a/trunk/fs/inode.c b/trunk/fs/inode.c index 006c85ca06eb..74d7c20fac88 100644 --- a/trunk/fs/inode.c +++ b/trunk/fs/inode.c @@ -1542,9 +1542,11 @@ void touch_atime(struct path *path) 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; /* * File systems can error out when updating inodes if they need to * allocate new space to modify an inode (such is the case for @@ -1553,7 +1555,9 @@ void touch_atime(struct path *path) * so just ignore the return value. */ update_time(inode, &now, S_ATIME); - mnt_drop_write(mnt); + __mnt_drop_write(mnt); +skip_update: + sb_end_write(inode->i_sb); } EXPORT_SYMBOL(touch_atime);