All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC] what the hell is ->f_mapping->host->i_mapping thing about?
Date: Mon, 21 Jun 2021 10:45:33 -0700	[thread overview]
Message-ID: <YNDQPTAn/vpC4gBq@gmail.com> (raw)
In-Reply-To: <YM/EcUZqqJ3RRu57@zeniv-ca.linux.org.uk>

On Sun, Jun 20, 2021 at 10:42:57PM +0000, Al Viro wrote:
> 	In do_dentry_open() we have the following weirdness:
> 
>         file_ra_state_init(&f->f_ra, f->f_mapping->host->i_mapping);
> 
> What is it about?  How and when can ->f_mapping->host->i_mapping be *NOT*
> equal to ->f_mapping?
> 
> It came from
> commit 1c211088833a27daa4512348bcae9890e8cf92d4
> Author: Andrew Morton <akpm@osdl.org>
> Date:   Wed May 26 17:35:42 2004 -0700
> 
>     [PATCH] Fix the setting of file->f_ra on block-special files
> 	
>     We need to set file->f_ra _after_ calling blkdev_open(), when inode->i_mapping
>     points at the right thing.  And we need to get it from
>     inode->i_mapping->host->i_mapping too, which represents the underlying device.
> 
>     Also, don't test for null file->f_mapping in the O_DIRECT checks.
> 
> Sure, we need to set ->f_ra after ->open(), since ->f_mapping might be
> changed by ->open().  No arguments here - that call should've been moved.
> But what the hell has the last bit come from?  What am I missing here?
> IDGI...
> 
> And that gift keeps giving -
> fs/nfs/nfs4file.c:388:  file_ra_state_init(&filep->f_ra, filep->f_mapping->host->i_mapping);
> is a copy of that thing.  Equally bogus, AFAICT...

FWIW, I came to the same conclusion that just ->f_mapping would be sufficient:
https://lkml.kernel.org/linux-fsdevel/20170326032128.32721-1-ebiggers3@gmail.com

- Eric

  reply	other threads:[~2021-06-21 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-20 22:42 [RFC] what the hell is ->f_mapping->host->i_mapping thing about? Al Viro
2021-06-21 17:45 ` Eric Biggers [this message]
2021-06-21 17:48   ` Al Viro

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=YNDQPTAn/vpC4gBq@gmail.com \
    --to=ebiggers@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --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 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.