From: Liu Bo <liubo2009@cn.fujitsu.com>
To: Alexander Block <ablock84@googlemail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] Btrfs: don't update atime on RO subvolumes
Date: Fri, 15 Jun 2012 17:41:36 +0800 [thread overview]
Message-ID: <4FDB0350.9000504@cn.fujitsu.com> (raw)
In-Reply-To: <CAB9VWqCJK8=Oy=tCdBAZg1jLRMguNrZE0i+cV_BZJoxrOpAP6A@mail.gmail.com>
On 06/15/2012 05:18 PM, Alexander Block wrote:
> On Fri, Jun 15, 2012 at 10:56 AM, Liu Bo <liubo2009@cn.fujitsu.com> wrote:
>>> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
>>> index f6ab6f5..4d0ceed 100644
>>> --- a/fs/btrfs/inode.c
>>> +++ b/fs/btrfs/inode.c
>>> @@ -4478,6 +4478,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;
>>> +
>>
>> It also needs to acquire root->fs_info->subvol_sem, doesn't it?
>>
>> thanks,
>> liubo
>>
>
> Normally yes I think. But does it matter at this point? If the flags are
> modified at the same time as we access them, wouldn't it be still
> random which value (old/new) we get, even with subvol_sem?
>
> (sorry for the double mail Liu...as always forgot Reply All)
>
I find other callers use btrfs_root_readonly without subvol_sem either,
anyway, I'm ok with this patch.
thanks,
liubo
prev parent reply other threads:[~2012-06-15 9:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-15 7:49 [PATCH v2] Btrfs: don't update atime on RO subvolumes Alexander Block
2012-06-15 8:56 ` Liu Bo
2012-06-15 9:18 ` Alexander Block
2012-06-15 9:41 ` Liu Bo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FDB0350.9000504@cn.fujitsu.com \
--to=liubo2009@cn.fujitsu.com \
--cc=ablock84@googlemail.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).