17 Oct, 2012

1 commit

  • Pull ext2, ext3, quota fixes from Jan Kara:
    "Fix three regressions caused by user namespace conversions (ext2,
    ext3, quota) and minor ext3 fix and cleanup."

    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    quota: Silence warning about PRJQUOTA not being handled in need_print_warning()
    ext3: fix return values on parse_options() failure
    ext2: fix return values on parse_options() failure
    ext3: ext3_bread usage audit
    ext3: fix possible non-initialized variable on htree_dirblock_to_tree()

    Linus Torvalds
     

13 Oct, 2012

1 commit

  • getname() is intended to copy pathname strings from userspace into a
    kernel buffer. The result is just a string in kernel space. It would
    however be quite helpful to be able to attach some ancillary info to
    the string.

    For instance, we could attach some audit-related info to reduce the
    amount of audit-related processing needed. When auditing is enabled,
    we could also call getname() on the string more than once and not
    need to recopy it from userspace.

    This patchset converts the getname()/putname() interfaces to return
    a struct instead of a string. For now, the struct just tracks the
    string in kernel space and the original userland pointer for it.

    Later, we'll add other information to the struct as it becomes
    convenient.

    Signed-off-by: Jeff Layton
    Signed-off-by: Al Viro

    Jeff Layton
     

10 Oct, 2012

1 commit


03 Oct, 2012

1 commit

  • Pull user namespace changes from Eric Biederman:
    "This is a mostly modest set of changes to enable basic user namespace
    support. This allows the code to code to compile with user namespaces
    enabled and removes the assumption there is only the initial user
    namespace. Everything is converted except for the most complex of the
    filesystems: autofs4, 9p, afs, ceph, cifs, coda, fuse, gfs2, ncpfs,
    nfs, ocfs2 and xfs as those patches need a bit more review.

    The strategy is to push kuid_t and kgid_t values are far down into
    subsystems and filesystems as reasonable. Leaving the make_kuid and
    from_kuid operations to happen at the edge of userspace, as the values
    come off the disk, and as the values come in from the network.
    Letting compile type incompatible compile errors (present when user
    namespaces are enabled) guide me to find the issues.

    The most tricky areas have been the places where we had an implicit
    union of uid and gid values and were storing them in an unsigned int.
    Those places were converted into explicit unions. I made certain to
    handle those places with simple trivial patches.

    Out of that work I discovered we have generic interfaces for storing
    quota by projid. I had never heard of the project identifiers before.
    Adding full user namespace support for project identifiers accounts
    for most of the code size growth in my git tree.

    Ultimately there will be work to relax privlige checks from
    "capable(FOO)" to "ns_capable(user_ns, FOO)" where it is safe allowing
    root in a user names to do those things that today we only forbid to
    non-root users because it will confuse suid root applications.

    While I was pushing kuid_t and kgid_t changes deep into the audit code
    I made a few other cleanups. I capitalized on the fact we process
    netlink messages in the context of the message sender. I removed
    usage of NETLINK_CRED, and started directly using current->tty.

    Some of these patches have also made it into maintainer trees, with no
    problems from identical code from different trees showing up in
    linux-next.

    After reading through all of this code I feel like I might be able to
    win a game of kernel trivial pursuit."

    Fix up some fairly trivial conflicts in netfilter uid/git logging code.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (107 commits)
    userns: Convert the ufs filesystem to use kuid/kgid where appropriate
    userns: Convert the udf filesystem to use kuid/kgid where appropriate
    userns: Convert ubifs to use kuid/kgid
    userns: Convert squashfs to use kuid/kgid where appropriate
    userns: Convert reiserfs to use kuid and kgid where appropriate
    userns: Convert jfs to use kuid/kgid where appropriate
    userns: Convert jffs2 to use kuid and kgid where appropriate
    userns: Convert hpfs to use kuid and kgid where appropriate
    userns: Convert btrfs to use kuid/kgid where appropriate
    userns: Convert bfs to use kuid/kgid where appropriate
    userns: Convert affs to use kuid/kgid wherwe appropriate
    userns: On alpha modify linux_to_osf_stat to use convert from kuids and kgids
    userns: On ia64 deal with current_uid and current_gid being kuid and kgid
    userns: On ppc convert current_uid from a kuid before printing.
    userns: Convert s390 getting uid and gid system calls to use kuid and kgid
    userns: Convert s390 hypfs to use kuid and kgid where appropriate
    userns: Convert binder ipc to use kuids
    userns: Teach security_path_chown to take kuids and kgids
    userns: Add user namespace support to IMA
    userns: Convert EVM to deal with kuids and kgids in it's hmac computation
    ...

    Linus Torvalds
     

18 Sep, 2012

7 commits

  • Now that the type changes are done, here is the final set of
    changes to make the quota code work when user namespaces are enabled.

    Small cleanups and fixes to make the code build when user namespaces
    are enabled.

    Cc: Jan Kara
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • Convert w_dq_id to be a struct kquid and remove the now unncessary
    w_dq_type.

    This is a simple conversion and enough other places have already
    been converted that this actually reduces the code complexity
    by a little bit, when removing now unnecessary type conversions.

    Cc: Jan Kara
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • Change struct dquot dq_id to a struct kqid and remove the now
    unecessary dq_type.

    Make minimal changes to dquot, quota_tree, quota_v1, quota_v2, ext3,
    ext4, and ocfs2 to deal with the change in quota structures and
    signatures. The ocfs2 changes are larger than most because of the
    extensive tracing throughout the ocfs2 quota code that prints out
    dq_id.

    quota_tree.c:get_index is modified to take a struct kqid instead of a
    qid_t because all of it's callers pass in dquot->dq_id and it allows
    me to introduce only a single conversion.

    The rest of the changes are either just replacing dq_type with dq_id.type,
    adding conversions to deal with the change in type and occassionally
    adding qid_eq to allow quota id comparisons in a user namespace safe way.

    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Jan Kara
    Cc: Andrew Morton
    Cc: Andreas Dilger
    Cc: Theodore Tso
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • Modify dqget to take struct kqid instead of a type and an identifier
    pair.

    Modify the callers of dqget in ocfs2 and dquot to take generate
    a struct kqid so they can continue to call dqget. The conversion
    to create struct kqid should all be the final conversions that
    are needed in those code paths.

    Cc: Jan Kara
    Cc: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • Modify quota_send_warning to take struct kqid instead a type and
    identifier pair.

    When sending netlink broadcasts always convert uids and quota
    identifiers into the intial user namespace. There is as yet no way to
    send a netlink broadcast message with different contents to receivers
    in different namespaces, so for the time being just map all of the
    identifiers into the initial user namespace which preserves the
    current behavior.

    Change the callers of quota_send_warning in gfs2, xfs and dquot
    to generate a struct kqid to pass to quota send warning. When
    all of the user namespaces convesions are complete a struct kqid
    values will be availbe without need for conversion, but a conversion
    is needed now to avoid needing to convert everything at once.

    Cc: Ben Myers
    Cc: Alex Elder
    Cc: Dave Chinner
    Cc: Jan Kara
    Cc: Steven Whitehouse
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • Update the quotactl user space interface to successfull compile with
    user namespaces support enabled and to hand off quota identifiers to
    lower layers of the kernel in struct kqid instead of type and qid
    pairs.

    The quota on function is not converted because while it takes a quota
    type and an id. The id is the on disk quota format to use, which
    is something completely different.

    The signature of two struct quotactl_ops methods were changed to take
    struct kqid argumetns get_dqblk and set_dqblk.

    The dquot, xfs, and ocfs2 implementations of get_dqblk and set_dqblk
    are minimally changed so that the code continues to work with
    the change in parameter type.

    This is the first in a series of changes to always store quota
    identifiers in the kernel in struct kqid and only use raw type and qid
    values when interacting with on disk structures or userspace. Always
    using struct kqid internally makes it hard to miss places that need
    conversion to or from the kernel internal values.

    Cc: Jan Kara
    Cc: Dave Chinner
    Cc: Mark Fasheh
    Cc: Joel Becker
    Cc: Ben Myers
    Cc: Alex Elder
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • Add the data type struct kqid which holds the kernel internal form of
    the owning identifier of a quota. struct kqid is a replacement for
    the implicit union of uid, gid and project id stored in an unsigned
    int and the quota type field that is was used in the quota data
    structures. Making the data type explicit allows the kuid_t and
    kgid_t type safety to propogate more thoroughly through the code,
    revealing more places where uid/gid conversions need be made.

    Along with the data type struct kqid comes the helper functions
    qid_eq, qid_lt, from_kqid, from_kqid_munged, qid_valid, make_kqid,
    make_kqid_invalid, make_kqid_uid, make_kqid_gid.

    Cc: Jan Kara
    Cc: Dave Chinner
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

15 Aug, 2012

1 commit


25 Jul, 2012

1 commit

  • Pull misc udf, ext2, ext3, and isofs fixes from Jan Kara:
    "Assorted, mostly trivial, fixes for udf, ext2, ext3, and isofs. I'm
    on vacation and scarcely checking email since we are expecting baby
    any day now but these fixes should be safe to go in and I don't want
    to delay them unnecessarily."

    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    udf: avoid info leak on export
    isofs: avoid info leak on export
    udf: Improve table length check to avoid possible overflow
    ext3: Check return value of blkdev_issue_flush()
    jbd: Check return value of blkdev_issue_flush()
    udf: Do not decrement i_blocks when freeing indirect extent block
    udf: Fix memory leak when mounting
    ext2: cleanup the confused goto label
    UDF: Remove unnecessary variable "offset" from udf_fill_inode
    udf: stop using s_dirt
    ext3: force ro mount if ext3_setup_super() fails
    quota: fix checkpatch.pl warning by replacing with

    Linus Torvalds
     

23 Jul, 2012

1 commit

  • Split off part of dquot_quota_sync() which writes dquots into a quota file
    to a separate function. In the next patch we will use the function from
    filesystems and we do not want to abuse ->quota_sync quotactl callback more
    than necessary.

    Acked-by: Steven Whitehouse
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara
    Signed-off-by: Al Viro

    Jan Kara
     

09 Jul, 2012

1 commit


16 May, 2012

3 commits

  • So far i_mutex was ranking above dqonoff_mutex and i_mutex on quota files
    was special and ranking below dqonoff_mutex (and several other locks).
    However there's no real need for i_mutex on quota files to be special.
    IO on quota files is serialized by dqio_mutex anyway so we don't need to
    take i_mutex when writing to quota files. Other places where we take i_mutex
    on quota file can accomodate standard i_mutex lock ranking, we only need
    to change the lock ranking to be dqonoff_mutex > i_mutex which is a matter
    of changing documentation because there's no place which would enforce
    ordering in the other direction.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • Signed-off-by: Jan Kara

    Jan Kara
     
  • When CONFIG_QUOTA_DEBUG is enabled we call inode_get_rsv_space() from
    add_dquot_ref() while holding i_lock. But inode_get_rsv_space() is trying
    to get i_lock as well resulting in double lock.

    Fix the problem by moving inode_get_rsv_space() call out of i_lock.

    Reported-and-analyzed-by: Jie Liu
    Signed-off-by: Jan Kara

    Jan Kara
     

29 Mar, 2012

1 commit

  • Pull ext3, UDF, and quota fixes from Jan Kara:
    "A couple of ext3 & UDF fixes and also one improvement in quota
    locking."

    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    ext3: fix start and len arguments handling in ext3_trim_fs()
    udf: Fix deadlock in udf_release_file()
    udf: Fix file entry logicalBlocksRecorded
    udf: Fix handling of i_blocks
    quota: Make quota code not call tty layer with dqptr_sem held
    udf: Init/maintain file entry checkpoint field
    ext3: Update ctime in ext3_splice_branch() only when needed
    ext3: Don't call dquot_free_block() if we don't update anything
    udf: Remove unnecessary OOM messages

    Linus Torvalds
     

24 Mar, 2012

1 commit

  • Pull XFS updates from Ben Myers:
    "Scalability improvements for dquots, log grant code cleanups, plus
    bugfixes and cleanups large and small"

    Fix up various trivial conflicts that were due to some of the earlier
    patches already having been integrated into v3.3 as bugfixes, and then
    there were development patches on top of those. Easily merged by just
    taking the newer version from the pulled branch.

    * 'for-linus' of git://oss.sgi.com/xfs/xfs: (45 commits)
    xfs: fallback to vmalloc for large buffers in xfs_getbmap
    xfs: fallback to vmalloc for large buffers in xfs_attrmulti_attr_get
    xfs: remove remaining scraps of struct xfs_iomap
    xfs: fix inode lookup race
    xfs: clean up minor sparse warnings
    xfs: remove the global xfs_Gqm structure
    xfs: remove the per-filesystem list of dquots
    xfs: use per-filesystem radix trees for dquot lookup
    xfs: per-filesystem dquot LRU lists
    xfs: use common code for quota statistics
    xfs: reimplement fdatasync support
    xfs: split in-core and on-disk inode log item fields
    xfs: make xfs_inode_item_size idempotent
    xfs: log timestamp updates
    xfs: log file size updates at I/O completion time
    xfs: log file size updates as part of unwritten extent conversion
    xfs: do not require an ioend for new EOF calculation
    xfs: use per-filesystem I/O completion workqueues
    quota: make Q_XQUOTASYNC a noop
    xfs: include reservations in quota reporting
    ...

    Linus Torvalds
     

22 Mar, 2012

1 commit

  • Pull security subsystem updates for 3.4 from James Morris:
    "The main addition here is the new Yama security module from Kees Cook,
    which was discussed at the Linux Security Summit last year. Its
    purpose is to collect miscellaneous DAC security enhancements in one
    place. This also marks a departure in policy for LSM modules, which
    were previously limited to being standalone access control systems.
    Chromium OS is using Yama, and I believe there are plans for Ubuntu,
    at least.

    This patchset also includes maintenance updates for AppArmor, TOMOYO
    and others."

    Fix trivial conflict in due to the jumo_label->static_key
    rename.

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (38 commits)
    AppArmor: Fix location of const qualifier on generated string tables
    TOMOYO: Return error if fails to delete a domain
    AppArmor: add const qualifiers to string arrays
    AppArmor: Add ability to load extended policy
    TOMOYO: Return appropriate value to poll().
    AppArmor: Move path failure information into aa_get_name and rename
    AppArmor: Update dfa matching routines.
    AppArmor: Minor cleanup of d_namespace_path to consolidate error handling
    AppArmor: Retrieve the dentry_path for error reporting when path lookup fails
    AppArmor: Add const qualifiers to generated string tables
    AppArmor: Fix oops in policy unpack auditing
    AppArmor: Fix error returned when a path lookup is disconnected
    KEYS: testing wrong bit for KEY_FLAG_REVOKED
    TOMOYO: Fix mount flags checking order.
    security: fix ima kconfig warning
    AppArmor: Fix the error case for chroot relative path name lookup
    AppArmor: fix mapping of META_READ to audit and quiet flags
    AppArmor: Fix underflow in xindex calculation
    AppArmor: Fix dropping of allowed operations that are force audited
    AppArmor: Add mising end of structure test to caps unpacking
    ...

    Linus Torvalds
     

01 Mar, 2012

2 commits

  • dqptr_sem can be called from slab reclaim. tty layer uses GFP_KERNEL mask for
    allocation so it can end up calling slab reclaim. Given quota code can call
    into tty layer to print warning this creates possibility for lock inversion
    between tty->atomic_write_lock and dqptr_sem.

    Using direct printing of warnings from quota layer is obsolete but since it's
    easy enough to change quota code to not hold any locks when printing warnings,
    let's just do it. It seems like a good thing to do even when we use netlink
    layer to transmit warnings to userspace.

    Reported-by: Markus
    Signed-off-by: Jan Kara

    Jan Kara
     
  • Now that XFS takes quota reservations into account there is no need to flush
    anything before reporting quotas - in addition to beeing fully transactional
    all quota information is also 100% coherent with the rest of the filesystem
    now.

    Reviewed-by: Dave Chinner
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Ben Myers

    Christoph Hellwig
     

14 Feb, 2012

2 commits

  • This script causes a kernel deadlock:
    set -e
    DEVICE=/dev/vg1/linear
    lvchange -ay $DEVICE
    mkfs.ext3 $DEVICE
    mount -t ext3 -o usrquota,grpquota $DEVICE /mnt/test
    quotacheck -gu /mnt/test
    umount /mnt/test
    mount -t ext3 -o usrquota,grpquota $DEVICE /mnt/test
    quotaon /mnt/test
    dmsetup suspend $DEVICE
    setquota -u root 1 2 3 4 /mnt/test &
    sleep 1
    dmsetup resume $DEVICE

    setquota acquired semaphore s_umount for read and then tried to perform a
    transaction (and waits because the device is suspended). dmsetup resume tries
    to acquire s_umount for write before resuming the device (and waits for
    setquota).

    Fix the deadlock by grabbing a thawed superblock for quota commands which need
    it.

    Reported-by: Mikulas Patocka
    Signed-off-by: Jan Kara
    Signed-off-by: Al Viro

    Jan Kara
     
  • Trim security.h

    Signed-off-by: Al Viro
    Signed-off-by: James Morris

    Al Viro
     

12 Jan, 2012

1 commit


07 Jan, 2012

1 commit


04 Jan, 2012

1 commit

  • Move invalidate_bdev, block_sync_page into fs/block_dev.c. Export
    kill_bdev as well, so brd doesn't have to open code it. Reduce
    buffer_head.h requirement accordingly.

    Removed a rather large comment from invalidate_bdev, as it looked a bit
    obsolete to bother moving. The small comment replacing it says enough.

    Signed-off-by: Nick Piggin
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Al Viro
     

07 Nov, 2011

1 commit

  • * 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
    writeback: Add a 'reason' to wb_writeback_work
    writeback: send work item to queue_io, move_expired_inodes
    writeback: trace event balance_dirty_pages
    writeback: trace event bdi_dirty_ratelimit
    writeback: fix ppc compile warnings on do_div(long long, unsigned long)
    writeback: per-bdi background threshold
    writeback: dirty position control - bdi reserve area
    writeback: control dirty pause time
    writeback: limit max dirty pause time
    writeback: IO-less balance_dirty_pages()
    writeback: per task dirty rate limit
    writeback: stabilize bdi->dirty_ratelimit
    writeback: dirty rate control
    writeback: add bg_threshold parameter to __bdi_update_bandwidth()
    writeback: dirty position control
    writeback: account per-bdi accumulated dirtied pages

    Linus Torvalds
     

03 Nov, 2011

1 commit

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    udf: Cleanup metadata flags handling
    udf: Skip mirror metadata FE loading when metadata FE is ok
    ext3: Allow quota file use root reservation
    udf: Remove web reference from UDF MAINTAINERS entry
    quota: Drop path reference on error exit from quotactl
    udf: Neaten udf_debug uses
    udf: Neaten logging output, use vsprintf extension %pV
    udf: Convert printks to pr_
    udf: Rename udf_warning to udf_warn
    udf: Rename udf_error to udf_err
    udf: Promote some debugging messages to udf_error
    ext3: Remove the obsolete broken EXT3_IOC32_WAIT_FOR_READONLY.
    udf: Add readpages support for udf.
    ext3/balloc.c: local functions should be static
    ext2: fix the outdated comment in ext2_nfs_get_inode()
    ext3: remove deprecated oldalloc
    fs/ext3/balloc.c: delete useless initialization
    fs/ext2/balloc.c: delete useless initialization
    ext3: fix message in ext3_remount for rw-remount case
    ext3: Remove i_mutex from ext3_sync_file()

    Fix up trivial (printf format cleanup) conflicts in fs/udf/udfdecl.h

    Linus Torvalds
     

01 Nov, 2011

1 commit


31 Oct, 2011

1 commit

  • This creates a new 'reason' field in a wb_writeback_work
    structure, which unambiguously identifies who initiates
    writeback activity. A 'wb_reason' enumeration has been
    added to writeback.h, to enumerate the possible reasons.

    The 'writeback_work_class' and tracepoint event class and
    'writeback_queue_io' tracepoints are updated to include the
    symbolic 'reason' in all trace events.

    And the 'writeback_inodes_sbXXX' family of routines has had
    a wb_stats parameter added to them, so callers can specify
    why writeback is being started.

    Acked-by: Jan Kara
    Signed-off-by: Curt Wohlgemuth
    Signed-off-by: Wu Fengguang

    Curt Wohlgemuth
     

27 Sep, 2011

1 commit

  • The concensus seems to be that system calls such as stat() etc should
    not trigger an automount. Neither should the l* versions.

    This patch therefore adds a LOOKUP_AUTOMOUNT flag to tag those lookups
    that _should_ trigger an automount on the last path element.

    Signed-off-by: Trond Myklebust
    [ Edited to leave out the cases that are already covered by LOOKUP_OPEN,
    LOOKUP_DIRECTORY and LOOKUP_CREATE - all of which also fundamentally
    force automounting for their own reasons - Linus ]
    Signed-off-by: Linus Torvalds

    Trond Myklebust
     

25 May, 2011

1 commit

  • Change each shrinker's API by consolidating the existing parameters into
    shrink_control struct. This will simplify any further features added w/o
    touching each file of shrinker.

    [akpm@linux-foundation.org: fix build]
    [akpm@linux-foundation.org: fix warning]
    [kosaki.motohiro@jp.fujitsu.com: fix up new shrinker API]
    [akpm@linux-foundation.org: fix xfs warning]
    [akpm@linux-foundation.org: update gfs2]
    Signed-off-by: Ying Han
    Cc: KOSAKI Motohiro
    Cc: Minchan Kim
    Acked-by: Pavel Emelyanov
    Cc: KAMEZAWA Hiroyuki
    Cc: Mel Gorman
    Acked-by: Rik van Riel
    Cc: Johannes Weiner
    Cc: Hugh Dickins
    Cc: Dave Hansen
    Cc: Steven Whitehouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ying Han
     

08 Apr, 2011

1 commit


01 Apr, 2011

1 commit

  • There's no reason to write quota info in dquot_commit(). The writing is a
    relict from the old days when we didn't have dquot_acquire() and
    dquot_release() and thus dquot_commit() could have created / removed quota
    structures from the file. These days dquot_commit() only updates usage counters
    / limits in quota structure and thus there's no need to write quota info.

    This also fixes an issue with journaling filesystem which didn't reserve
    enough space in the transaction for write of quota info (it could have been
    dirty at the time of dquot_commit() because of a race with other operation
    changing it).

    CC: stable@kernel.org
    Reported-and-tested-by: Lukas Czerner
    Signed-off-by: Jan Kara

    Jan Kara
     

31 Mar, 2011

1 commit


25 Mar, 2011

2 commits

  • Protect the per-sb inode list with a new global lock
    inode_sb_list_lock and use it to protect the list manipulations and
    traversals. This lock replaces the inode_lock as the inodes on the
    list can be validity checked while holding the inode->i_lock and
    hence the inode_lock is no longer needed to protect the list.

    Signed-off-by: Dave Chinner
    Signed-off-by: Al Viro

    Dave Chinner
     
  • Protect inode state transitions and validity checks with the
    inode->i_lock. This enables us to make inode state transitions
    independently of the inode_lock and is the first step to peeling
    away the inode_lock from the code.

    This requires that __iget() is done atomically with i_state checks
    during list traversals so that we don't race with another thread
    marking the inode I_FREEING between the state check and grabbing the
    reference.

    Also remove the unlock_new_inode() memory barrier optimisation
    required to avoid taking the inode_lock when clearing I_NEW.
    Simplify the code by simply taking the inode->i_lock around the
    state change and wakeup. Because the wakeup is no longer tricky,
    remove the wake_up_inode() function and open code the wakeup where
    necessary.

    Signed-off-by: Dave Chinner
    Signed-off-by: Al Viro

    Dave Chinner
     

24 Feb, 2011

1 commit