--- linux-2.4.20/mm/filemap.c Fri Jan 10 16:36:03 2003 +++ linux/mm/filemap.c Fri Jul 4 20:18:44 2003 @@ -1700,8 +1700,10 @@ retval = generic_file_direct_IO(READ, filp, buf, count, pos); if (retval > 0) *ppos = pos + retval; + } - UPDATE_ATIME(filp->f_dentry->d_inode); + if (!S_ISBLK(inode->i_mode)) + UPDATE_ATIME(filp->f_dentry->d_inode); goto out; } } @@ -3044,8 +3046,12 @@ goto out; remove_suid(inode); - inode->i_ctime = inode->i_mtime = CURRENT_TIME; - mark_inode_dirty_sync(inode); + + /* Don't update times for block devices using O_DIRECT */ + if (!(file->f_flags & O_DIRECT) || !S_ISBLK(inode->i_mode)) { + inode->i_ctime = inode->i_mtime = CURRENT_TIME; + mark_inode_dirty_sync(inode); + } if (file->f_flags & O_DIRECT) goto o_direct;