Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1741573

Re: [RFC PATCH 1/3] fs: define new read_iter rwf flag

From Matthew Wilcox <willy@infradead.org>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 1/3] fs: define new read_iter rwf flag
Date 2017-09-28 16:00 +0200
Message-ID <uuHw5-1ff-7@gated-at.bofh.it> (permalink)
References <uuGql-C7-5@gated-at.bofh.it> <uuGqn-C7-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Sep 28, 2017 at 08:39:31AM -0400, Mimi Zohar wrote:
> Writing extended attributes requires exclusively taking the i_rwsem
> lock.  To synchronize the file hash calculation and writing the file
> hash as security.ima xattr, IMA-appraisal takes the i_rwsem lock
> exclusively before calculating the file hash.  (Once the file hash
> is calculated, the result is cached.  Taking the lock exclusively
> prevents calculating the file hash multiple times.)
> 
> Some filesystems have recently replaced their filesystem dependent
> lock with the global i_rwsem to read a file.  As a result, when IMA
> attempts to calculate the file hash, reading the file attempts to
> take the i_rwsem again.
> 
> To resolve this problem, this patch defines a new read_iter flag
> named "rwf" to indicate that the i_rwsem has already been taken
> exclusively.  Subsequent patches will set or test the "rwf" flag.

I don't like adding a bool parameter everywhere.  Why not add a flag
to the kiocb ki_flags?

#define IOCB_RWSEM_HELD		(1 << 8)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH 0/3] define new read_iter file operation rwf flag Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-28 14:50 +0200
  [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-28 14:50 +0200
    Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Dave Chinner <david@fromorbit.com> - 2017-09-29 00:10 +0200
      Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-29 01:40 +0200
        Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-29 02:20 +0200
          Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-29 02:40 +0200
            Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-29 04:00 +0200
              Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-29 05:30 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively ebiederm@xmission.com (Eric W. Biederman) - 2017-10-01 03:40 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-10-01 14:10 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Linus Torvalds <torvalds@linux-foundation.org> - 2017-10-01 20:50 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Dave Chinner <david@fromorbit.com> - 2017-10-02 00:40 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Linus Torvalds <torvalds@linux-foundation.org> - 2017-10-02 01:20 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Dave Chinner <david@fromorbit.com> - 2017-10-02 06:00 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-10-02 01:50 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively ebiederm@xmission.com (Eric W. Biederman) - 2017-10-02 05:30 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-10-02 14:30 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Dave Chinner <david@fromorbit.com> - 2017-10-02 06:40 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-10-02 14:20 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Jeff Layton <jlayton@redhat.com> - 2017-10-02 14:50 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively ebiederm@xmission.com (Eric W. Biederman) - 2017-10-02 00:10 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Linus Torvalds <torvalds@linux-foundation.org> - 2017-10-02 00:30 +0200
                Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been  taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-10-02 02:00 +0200
  [RFC PATCH 1/3] fs: define new read_iter rwf flag Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-28 14:50 +0200
    Re: [RFC PATCH 1/3] fs: define new read_iter rwf flag Matthew Wilcox <willy@infradead.org> - 2017-09-28 16:00 +0200
      Re: [RFC PATCH 1/3] fs: define new read_iter rwf flag Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-28 16:40 +0200
      Re: [RFC PATCH 1/3] fs: define new read_iter rwf flag Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-28 18:00 +0200

csiph-web