diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-06-24 13:19:53 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-06-24 13:19:53 -0400 |
commit | d2abae71ebcc409828b24ce9da402548ecdf1311 (patch) | |
tree | 5edfafc2828d3bcebb3698520ccba374cd4328c0 /fs/overlayfs/inode.c | |
parent | 66567fcbaecac455caa1b13643155d686b51ce63 (diff) | |
parent | 4b972a01a7da614b4796475f933094751a295a2f (diff) |
Merge tag 'v5.2-rc6' into sched/core, to refresh the branch
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/overlayfs/inode.c')
-rw-r--r-- | fs/overlayfs/inode.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index f7eba21effa5..7663aeb85fa3 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c | |||
@@ -1,10 +1,7 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
1 | /* | 2 | /* |
2 | * | 3 | * |
3 | * Copyright (C) 2011 Novell Inc. | 4 | * Copyright (C) 2011 Novell Inc. |
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License version 2 as published by | ||
7 | * the Free Software Foundation. | ||
8 | */ | 5 | */ |
9 | 6 | ||
10 | #include <linux/fs.h> | 7 | #include <linux/fs.h> |
@@ -553,15 +550,15 @@ static void ovl_fill_inode(struct inode *inode, umode_t mode, dev_t rdev, | |||
553 | int xinobits = ovl_xino_bits(inode->i_sb); | 550 | int xinobits = ovl_xino_bits(inode->i_sb); |
554 | 551 | ||
555 | /* | 552 | /* |
556 | * When NFS export is enabled and d_ino is consistent with st_ino | 553 | * When d_ino is consistent with st_ino (samefs or i_ino has enough |
557 | * (samefs or i_ino has enough bits to encode layer), set the same | 554 | * bits to encode layer), set the same value used for st_ino to i_ino, |
558 | * value used for d_ino to i_ino, because nfsd readdirplus compares | 555 | * so inode number exposed via /proc/locks and a like will be |
559 | * d_ino values to i_ino values of child entries. When called from | 556 | * consistent with d_ino and st_ino values. An i_ino value inconsistent |
557 | * with d_ino also causes nfsd readdirplus to fail. When called from | ||
560 | * ovl_new_inode(), ino arg is 0, so i_ino will be updated to real | 558 | * ovl_new_inode(), ino arg is 0, so i_ino will be updated to real |
561 | * upper inode i_ino on ovl_inode_init() or ovl_inode_update(). | 559 | * upper inode i_ino on ovl_inode_init() or ovl_inode_update(). |
562 | */ | 560 | */ |
563 | if (inode->i_sb->s_export_op && | 561 | if (ovl_same_sb(inode->i_sb) || xinobits) { |
564 | (ovl_same_sb(inode->i_sb) || xinobits)) { | ||
565 | inode->i_ino = ino; | 562 | inode->i_ino = ino; |
566 | if (xinobits && fsid && !(ino >> (64 - xinobits))) | 563 | if (xinobits && fsid && !(ino >> (64 - xinobits))) |
567 | inode->i_ino |= (unsigned long)fsid << (64 - xinobits); | 564 | inode->i_ino |= (unsigned long)fsid << (64 - xinobits); |