All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junxiao Bi <junxiao.bi@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: using i_size_read() to access i_size
Date: Fri, 19 Jul 2013 16:12:34 +0800	[thread overview]
Message-ID: <51E8F4F2.7010205@oracle.com> (raw)
In-Reply-To: <51E8F2E0.6000207@oracle.com>

Hi Jeff,

On 07/19/2013 04:03 PM, Jeff Liu wrote:
> Hi Junxiao,
>
> On 07/19/2013 03:38 PM, Junxiao Bi wrote:
>
>> Hi Jeff,
>>
>> On 07/17/2013 07:13 AM, Jeff Liu wrote:
>>>>> diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
>>>>>>> index 3ce6a8b..7158710 100644
>>>>>>> --- a/fs/ocfs2/file.c
>>>>>>> +++ b/fs/ocfs2/file.c
>>>>>>> @@ -2650,7 +2650,7 @@ static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int whence)
>>> We have the inode mutex around ocfs2_file_llseek(), and that is too extensive
>>> to block the concurrent access for particular seek operations.  At least,
>>> we can get rid of this lock for SEEK_SET/SEEK_CUR. i.e,  In either case,
>>> we can fall through generic_file_llseek() directly without the mutex lock.
>> Think about this again, I think we can't remove the mutex, as it is used
>> to protect other inode member beside i_size, like
>> inode->i_sb->s_maxbytes which is accessed in all SEEK request and also
>> more in ocfs2_inode_lock().
> Thanks for digging into this.  s_maxbytes is a numeric constant which is
> calculated out at OCFS2 mount with filling up the super blocks, IOWs, it
> does not need any lock protection IMO.
>
> Besides that, could you please pointed me out anything am missed?
Can inode->i_sb be set to NULL during this?

Thanks,
Junxiao.
>
> Thanks,
> -Jeff
>
>> Thanks,
>> Junxiao.
>>>>>>>  	case SEEK_SET:
>>>>>>>  		break;
>>>>>>>  	case SEEK_END:
>>>>>>> -		offset += inode->i_size;
>>>>>>> +		offset += i_size_read(inode);
>

  reply	other threads:[~2013-07-19  8:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15  8:16 [Ocfs2-devel] [PATCH] ocfs2: using i_size_read() to access i_size Junxiao Bi
2013-07-16  3:05 ` Tao Ma
2013-07-16 23:13   ` Jeff Liu
2013-07-17  1:23     ` Junxiao Bi
2013-07-19  7:38     ` Junxiao Bi
2013-07-19  8:03       ` Jeff Liu
2013-07-19  8:12         ` Junxiao Bi [this message]
2013-07-19  8:30           ` Jeff Liu
2013-07-19  9:16             ` Junxiao Bi
2013-07-19  9:50               ` Jeff Liu
2013-07-22  8:57                 ` Junxiao Bi
2013-07-17  0:48   ` Junxiao Bi

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=51E8F4F2.7010205@oracle.com \
    --to=junxiao.bi@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.