|
@@ -6107,19 +6107,20 @@ static int btrfs_update_time(struct inode *inode, struct timespec *now,
|
|
|
int flags)
|
|
int flags)
|
|
|
{
|
|
{
|
|
|
struct btrfs_root *root = BTRFS_I(inode)->root;
|
|
struct btrfs_root *root = BTRFS_I(inode)->root;
|
|
|
|
|
+ bool dirty = flags & ~S_VERSION;
|
|
|
|
|
|
|
|
if (btrfs_root_readonly(root))
|
|
if (btrfs_root_readonly(root))
|
|
|
return -EROFS;
|
|
return -EROFS;
|
|
|
|
|
|
|
|
if (flags & S_VERSION)
|
|
if (flags & S_VERSION)
|
|
|
- inode_inc_iversion(inode);
|
|
|
|
|
|
|
+ dirty |= inode_maybe_inc_iversion(inode, dirty);
|
|
|
if (flags & S_CTIME)
|
|
if (flags & S_CTIME)
|
|
|
inode->i_ctime = *now;
|
|
inode->i_ctime = *now;
|
|
|
if (flags & S_MTIME)
|
|
if (flags & S_MTIME)
|
|
|
inode->i_mtime = *now;
|
|
inode->i_mtime = *now;
|
|
|
if (flags & S_ATIME)
|
|
if (flags & S_ATIME)
|
|
|
inode->i_atime = *now;
|
|
inode->i_atime = *now;
|
|
|
- return btrfs_dirty_inode(inode);
|
|
|
|
|
|
|
+ return dirty ? btrfs_dirty_inode(inode) : 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
/*
|