All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: "Kenneth R. Crudup" <kenny@panix.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Commit 0be0ee71 ("fs: properly and reliably lock f_pos in fdget_pos()") breaking userspace
Date: Mon, 25 Nov 2019 17:58:43 -0800	[thread overview]
Message-ID: <CAHk-=whn2Dp44tjUpLo9ogs=p-v-Vn7c2Xdo4p+2V=d1hTaiuA@mail.gmail.com> (raw)
In-Reply-To: <CAHk-=wj_nbDN3piDJBEteUrjyrZCTA+CCk15NfV=5D2xFfGJGw@mail.gmail.com>

On Mon, Nov 25, 2019 at 2:55 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> Anyway, here's a TOTALLY UNTESTED patch that may help pinpoint which
> thing it is that causes issues.
>
> It might also be so noisy as to be useless, I didn't think it through
> a lot.

Yeah, I ended up testing it between merges, and it points out a lot of
files. Too many to usefully narrow down which one then might cause
problems for you.

The main cause of that is that it will complain for _every_ O_PATH
open, because those use the 'empty_fops' and don't actually allow any
operations at all (neither read/write nor llseek). We could have
marked those O_STREAM, since they can't be used for any seeking
operations.

So to get rid of at least _that_ endless noise, add this to the patch:

  --- a/fs/open.c
  +++ b/fs/open.c
  @@ -748,7 +748,7 @@ static int do_dentry_open(struct file *f,
          f->f_wb_err = filemap_sample_wb_err(f->f_mapping);

          if (unlikely(f->f_flags & O_PATH)) {
  -               f->f_mode = FMODE_PATH | FMODE_OPENED;
  +               f->f_mode = FMODE_PATH | FMODE_OPENED | FMODE_STREAM;
                  f->f_op = &empty_fops;
                  return 0;
          }

the above is entirely whitespace-damaged, but you can see what it's
doing. That should cut down on all the noise generated by O_PATH
opens.

It might still be a bit noisy even with the above, but I think it will
at least be better.

              Linus

  reply	other threads:[~2019-11-26  1:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 21:30 Commit 0be0ee71 ("fs: properly and reliably lock f_pos in fdget_pos()") breaking userspace Kenneth R. Crudup
2019-11-25 22:55 ` Linus Torvalds
2019-11-26  1:58   ` Linus Torvalds [this message]
2019-11-26  2:03     ` Kenneth R. Crudup
2019-11-26  3:21     ` Linus Torvalds
2019-11-26  3:34       ` Linus Torvalds
2019-11-26  3:39       ` Linus Torvalds
2019-11-26 10:00         ` Kirill Smelkov
2019-11-26 12:46           ` Kenneth R. Crudup
2019-11-27  8:12             ` Kirill Smelkov
2019-11-26 20:03         ` Linus Torvalds

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='CAHk-=whn2Dp44tjUpLo9ogs=p-v-Vn7c2Xdo4p+2V=d1hTaiuA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=kenny@panix.com \
    --cc=linux-kernel@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 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.