|
@@ -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);
|
|
|
|