summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorAlexander Block2012-06-15 09:49:33 +0200
committerChris Mason2012-07-23 21:41:38 +0200
commit2bc5565286121d2a77ccd728eb3484dff2035b58 (patch)
treecb2ec5d12e7427a1cec9c41c7576118bb112b1dd /fs/btrfs
parentBtrfs: allow mount -o remount,compress=no (diff)
downloadkernel-qcow2-linux-2bc5565286121d2a77ccd728eb3484dff2035b58.tar.gz
kernel-qcow2-linux-2bc5565286121d2a77ccd728eb3484dff2035b58.tar.xz
kernel-qcow2-linux-2bc5565286121d2a77ccd728eb3484dff2035b58.zip
Btrfs: don't update atime on RO subvolumes
Before the update_time inode operation was indroduced, it was not possible to prevent updates of atime on RO subvolumes. VFS was only able to check for RO on the mount, but did not know anything about btrfs subvolumes. btrfs_update_time does now check if the root is RO and skip updating of times. Signed-off-by: Alexander Block <ablock84@googlemail.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/inode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a7d1921ac76b..fcc65802f367 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4518,6 +4518,11 @@ int btrfs_dirty_inode(struct inode *inode)
static int btrfs_update_time(struct inode *inode, struct timespec *now,
int flags)
{
+ struct btrfs_root *root = BTRFS_I(inode)->root;
+
+ if (btrfs_root_readonly(root))
+ return -EROFS;
+
if (flags & S_VERSION)
inode_inc_iversion(inode);
if (flags & S_CTIME)