Pull VFS fixes from Al Viro: "A bunch of assorted fixes, most of them followups to overlayfs merge" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: ovl: initialize ->is_cursor Return short read or 0 at end of a raw device, not EIO isofs: don't bother with ->d_op for normal case isofs_cmp(): we'll never see a dentry for . or .. overlayfs: fix lockdep misannotation ovl: fix check for cursor overlayfs: barriers for opening upper-layer directory rcu: Provide counterpart to rcu_dereference() for non-RCU situations staging: android: logger: Fix log corruption regression
Showing the changes to include/linux (2 of 9 files). Show all
Unified · Split
| @@ -639,11 +639,13 @@ static inline int inode_unhashed(struct inode *inode) · 638 unmodified lines | ||
| 639 | 639 | * 2: child/target |
| 640 | 640 | * 3: xattr |
| 641 | 641 | * 4: second non-directory |
| 642 | − * The last is for certain operations (such as rename) which lock two | |
| 642 | + * 5: second parent (when locking independent directories in rename) | |
| 643 | + * | |
| 644 | + * I_MUTEX_NONDIR2 is for certain operations (such as rename) which lock two | |
| 643 | 645 | * non-directories at once. |
| 644 | 646 | * |
| 645 | 647 | * The locking order between these classes is |
| 646 | − * parent -> child -> normal -> xattr -> second non-directory | |
| 648 | + * parent[2] -> child -> grandchild -> normal -> xattr -> second non-directory | |
| 647 | 649 | */ |
| 648 | 650 | enum inode_i_mutex_lock_class |
| 649 | 651 | { |
| @@ -651,7 +653,8 @@ enum inode_i_mutex_lock_class · 1 unmodified line | ||
| 651 | 653 | I_MUTEX_PARENT, |
| 652 | 654 | I_MUTEX_CHILD, |
| 653 | 655 | I_MUTEX_XATTR, |
| 654 | − I_MUTEX_NONDIR2 | |
| 656 | + I_MUTEX_NONDIR2, | |
| 657 | + I_MUTEX_PARENT2, | |
| 655 | 658 | }; |
| 656 | 659 | |
| 657 | 660 | void lock_two_nondirectories(struct inode *, struct inode*); |
| @@ -2466,6 +2469,7 @@ extern ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, lo · 1808 unmodified lines | ||
| 2466 | 2469 | extern ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); |
| 2467 | 2470 | |
| 2468 | 2471 | /* fs/block_dev.c */ |
| 2472 | +extern ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to); | |
| 2469 | 2473 | extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from); |
| 2470 | 2474 | extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, |
| 2471 | 2475 | int datasync); |
| @@ -616,6 +616,21 @@ static inline void rcu_preempt_sleep_check(void) · 615 unmodified lines | ||
| 616 | 616 | */ |
| 617 | 617 | #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v) |
| 618 | 618 | |
| 619 | +/** | |
| 620 | + * lockless_dereference() - safely load a pointer for later dereference | |
| 621 | + * @p: The pointer to load | |
| 622 | + * | |
| 623 | + * Similar to rcu_dereference(), but for situations where the pointed-to | |
| 624 | + * object's lifetime is managed by something other than RCU. That | |
| 625 | + * "something other" might be reference counting or simple immortality. | |
| 626 | + */ | |
| 627 | +#define lockless_dereference(p) \ | |
| 628 | +({ \ | |
| 629 | + typeof(p) _________p1 = ACCESS_ONCE(p); \ | |
| 630 | + smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ | |
| 631 | + (_________p1); \ | |
| 632 | +}) | |
| 633 | + | |
| 619 | 634 | /** |
| 620 | 635 | * rcu_assign_pointer() - assign to RCU-protected pointer |
| 621 | 636 | * @p: pointer to assign to |