lkml.org 
[lkml]   [2019]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.1 105/121] ovl: make i_ino consistent with st_ino in more cases
    Date
    From: Amir Goldstein <amir73il@gmail.com>

    commit 6dde1e42f497b2d4e22466f23019016775607947 upstream.

    Relax the condition that overlayfs supports nfs export, to require
    that i_ino is consistent with st_ino/d_ino.

    It is enough to require that st_ino and d_ino are consistent.

    This fixes the failure of xfstest generic/504, due to mismatch of
    st_ino to inode number in the output of /proc/locks.

    Fixes: 12574a9f4c9c ("ovl: consistent i_ino for non-samefs with xino")
    Cc: <stable@vger.kernel.org> # v4.19
    Signed-off-by: Amir Goldstein <amir73il@gmail.com>
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/overlayfs/inode.c | 12 ++++++------
    1 file changed, 6 insertions(+), 6 deletions(-)

    --- a/fs/overlayfs/inode.c
    +++ b/fs/overlayfs/inode.c
    @@ -553,15 +553,15 @@ static void ovl_fill_inode(struct inode
    int xinobits = ovl_xino_bits(inode->i_sb);

    /*
    - * When NFS export is enabled and d_ino is consistent with st_ino
    - * (samefs or i_ino has enough bits to encode layer), set the same
    - * value used for d_ino to i_ino, because nfsd readdirplus compares
    - * d_ino values to i_ino values of child entries. When called from
    + * When d_ino is consistent with st_ino (samefs or i_ino has enough
    + * bits to encode layer), set the same value used for st_ino to i_ino,
    + * so inode number exposed via /proc/locks and a like will be
    + * consistent with d_ino and st_ino values. An i_ino value inconsistent
    + * with d_ino also causes nfsd readdirplus to fail. When called from
    * ovl_new_inode(), ino arg is 0, so i_ino will be updated to real
    * upper inode i_ino on ovl_inode_init() or ovl_inode_update().
    */
    - if (inode->i_sb->s_export_op &&
    - (ovl_same_sb(inode->i_sb) || xinobits)) {
    + if (ovl_same_sb(inode->i_sb) || xinobits) {
    inode->i_ino = ino;
    if (xinobits && fsid && !(ino >> (64 - xinobits)))
    inode->i_ino |= (unsigned long)fsid << (64 - xinobits);

    \
     
     \ /
      Last update: 2019-06-24 12:17    [W:3.733 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site