CEPH filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Xiubo Li <xiubli@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>,
	idryomov@gmail.com, jlayton@kernel.org,
	ceph-devel@vger.kernel.org
Subject: Re: [PATCH] ceph: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method
Date: Tue, 13 Jun 2023 08:01:21 +0200	[thread overview]
Message-ID: <20230613060121.GA14924@lst.de> (raw)
In-Reply-To: <366e91fa-53b9-008d-8aea-7498d452b234@redhat.com> <099cc669-11b9-e5f1-e370-599679e87806@redhat.com>

On Tue, Jun 13, 2023 at 08:57:42AM +0800, Xiubo Li wrote:
>> +	if (S_ISREG(inode->i_mode))
>> +		file->f_mode |= FMODE_CAN_ODIRECT;
>>   
>
> Shouldn't we do the same in 'ceph_atomic_open()' too ?

Yes, probably.  Or I really need to press ahead and move the flag
to file operations..

>> --- a/fs/ceph/file.c
>> +++ b/fs/ceph/file.c
>> @@ -368,6 +368,8 @@ int ceph_open(struct inode *inode, struct file *file)
>>   	flags = file->f_flags & ~(O_CREAT|O_EXCL);
>>   	if (S_ISDIR(inode->i_mode))
>>   		flags = O_DIRECTORY;  /* mds likes to know */
>> +	if (S_ISREG(inode->i_mode))
>
> BTW, the commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") 
> doesn't check the S_ISREG, and I couldn't see this commit and NFS confine 
> it to regular files, is that okay ?

It doesn't have to.  ->direct_IO was previously set only for regular
files (and block devices in the block code).  So it makes sense to do
the same for the flag.

  reply	other threads:[~2023-06-13  6:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12  5:35 [PATCH] ceph: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method Christoph Hellwig
2023-06-13  0:57 ` Xiubo Li
2023-06-13  6:01   ` Christoph Hellwig [this message]
2023-06-13  1:06 ` Xiubo Li

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=20230613060121.GA14924@lst.de \
    --to=hch@lst.de \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=xiubli@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox