From: Vladimir Saveliev This patch fixes a bug which might be hit on inode access time update. Signed-off-by: Vladimir Saveliev Cc: Hans Reiser Signed-off-by: Andrew Morton --- fs/reiser4/plugin/file/file.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff -puN fs/reiser4/plugin/file/file.c~reiser4-atime-update-fix fs/reiser4/plugin/file/file.c --- devel/fs/reiser4/plugin/file/file.c~reiser4-atime-update-fix 2005-11-16 17:34:24.000000000 -0800 +++ devel-akpm/fs/reiser4/plugin/file/file.c 2005-11-16 17:34:27.000000000 -0800 @@ -1982,14 +1982,6 @@ read_unix_file(struct file *file, char _ if (IS_ERR(ctx)) return PTR_ERR(ctx); - needed = unix_file_estimate_read(inode, read_amount); - result = reiser4_grab_space(needed, BA_CAN_COMMIT); - if (result != 0) { - context_set_commit_async(ctx); - reiser4_exit_context(ctx); - return result; - } - hint = kmalloc(sizeof(*hint), GFP_KERNEL); if (hint == NULL) { context_set_commit_async(ctx); @@ -2078,8 +2070,16 @@ read_unix_file(struct file *file, char _ kfree(hint); if (count) { - /* something was read. Update inode's atime and stat data */ - update_atime(inode); + /* + * something was read. Grab space for stat data update and + * update atime + */ + needed = unix_file_estimate_read(inode, read_amount); + result = reiser4_grab_space_force(needed, BA_CAN_COMMIT); + if (result == 0) + update_atime(inode); + else + warning("", "failed to grab space for atime update"); } context_set_commit_async(ctx); _