mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-erofs@lists.ozlabs.org, LKML <linux-kernel@vger.kernel.org>,
	syzbot+0b1279812c46e48bb0c1@syzkaller.appspotmail.com
Subject: Re: [PATCH v2] erofs: fix file-backed mounts over FUSE
Date: Fri, 15 Nov 2024 07:26:31 +0800	[thread overview]
Message-ID: <e878e14a-eec7-4df4-b33d-f2defa8a92cb@linux.alibaba.com> (raw)
In-Reply-To: <20241114161823.GN3387508@ZenIV>



On 2024/11/15 00:18, Al Viro wrote:
> On Thu, Nov 14, 2024 at 05:01:09PM +0800, Gao Xiang wrote:
>> --- a/fs/erofs/data.c
>> +++ b/fs/erofs/data.c
>> @@ -38,7 +38,9 @@ void *erofs_bread(struct erofs_buf *buf, erofs_off_t offset,
>>   	}
>>   	if (!folio || !folio_contains(folio, index)) {
>>   		erofs_put_metabuf(buf);
>> -		folio = read_mapping_folio(buf->mapping, index, NULL);
>> +		folio = buf->file ? read_mapping_folio(buf->file->f_mapping,
>> +					index, buf->file) :
>> +			read_mapping_folio(buf->mapping, index, NULL);
>>   		if (IS_ERR(folio))
>>   			return folio;
>>   	}
>> @@ -61,8 +63,8 @@ void erofs_init_metabuf(struct erofs_buf *buf, struct super_block *sb)
>>   {
>>   	struct erofs_sb_info *sbi = EROFS_SB(sb);
>>   
>> -	if (erofs_is_fileio_mode(sbi))
>> -		buf->mapping = file_inode(sbi->fdev)->i_mapping;
>> +	if (erofs_is_fileio_mode(sbi))	/* some fs like FUSE needs it */
>> +		buf->file = sbi->fdev;
> 
> Would be easier to set *both* ->mapping and ->file at that point, so that
> erofs_bread() would just have read_mapping_folio(buf->mapping, index, buf->file),
> unconditionally...

Ok, will do the next version.

Thanks,
Gao Xiang

      reply	other threads:[~2024-11-14 23:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14  9:01 Gao Xiang
2024-11-14 16:18 ` Al Viro
2024-11-14 23:26   ` Gao Xiang [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=e878e14a-eec7-4df4-b33d-f2defa8a92cb@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+0b1279812c46e48bb0c1@syzkaller.appspotmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®