Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2329464imm; Fri, 7 Sep 2018 14:46:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbXWfmC0bTpGozkTRDNjff+wUYwP6JlDthZVnZeEnDnoy16Lolc/Kb8WY4M+75xzVsCsYAs X-Received: by 2002:a63:8f17:: with SMTP id n23-v6mr10433042pgd.131.1536356799849; Fri, 07 Sep 2018 14:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536356799; cv=none; d=google.com; s=arc-20160816; b=axUDmpyqUzVcOl7RiRddCX0L32RXEgdIAivbQGpcbNFWHiUaPez2zNT36pZNpcKN4d +IkudNXtnsrsM3YiAbv0J2ev1lvKa9hOnlAnmIWTWhRNaNIpHfZ7n1kSofZAYdPnXZFr HDDV28hcLsaqeCfe4BAHQiOfAA9eIzlMMRujL6YVizz/x0mbwS15bYTk1MfQdCRwhx7V +2oLTKaCVgxOQBvV+KMWWfESoMhXZnKzvcJP/FhAwMQqmkS7QQGvgUHoWRF94iL99+/7 tV93mBKbhSN+L7Z1LYpEPF6dfPmDnflwWo/dxbLVQstaSZt6KaL6eY/ktJL5WLu1xPdn hCXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from; bh=Iov4Uz/847B+NKW6X3/3P5tnVXLfXxPp0UJSeajSjY8=; b=yVgrh7D+R6k5J2jsCA+hMqaxVw4iWxcoz5RLdylJmKs6fnPlCU9mQVHDWzEvJ4e6tr VLPFsitC0Y22ecu0qRoqXKR1aelQOPCHgLncxZYqdFYVgjbI2ksPQo7Vp8s/w3g/S5BV GmDPguhkTLvWowmD5+c224m3VsSNwuDHxQZMrRcaT6YTb1LDZ8x/Nxb36mt06WugPhSn TRj4tsH4fMs6pQxcu81TQRTt12kqfHidChE3eerqCuTmmzprAN8BxRCZ/PpmSyAZnjwM T1wJfADR+ORFTC0cTk8Oe0GeCjUev62Pevx9cUHU7f+U3M3n6A0XyqeNr3HgiHlDJvzl mhxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t191-v6si10044354pgc.481.2018.09.07.14.46.24; Fri, 07 Sep 2018 14:46:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730985AbeIHC10 (ORCPT + 99 others); Fri, 7 Sep 2018 22:27:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57752 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727983AbeIHC10 (ORCPT ); Fri, 7 Sep 2018 22:27:26 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 19A2AF36; Fri, 7 Sep 2018 21:44:29 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Richard Weinberger Subject: [PATCH 3.18 24/29] ubifs: Fix synced_i_size calculation for xattr inodes Date: Fri, 7 Sep 2018 23:10:45 +0200 Message-Id: <20180907210911.141394003@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907210909.523240901@linuxfoundation.org> References: <20180907210909.523240901@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Richard Weinberger commit 59965593205fa4044850d35ee3557cf0b7edcd14 upstream. In ubifs_jnl_update() we sync parent and child inodes to the flash, in case of xattrs, the parent inode (AKA host inode) has a non-zero data_len. Therefore we need to adjust synced_i_size too. This issue was reported by ubifs self tests unter a xattr related work load. UBIFS error (ubi0:0 pid 1896): dbg_check_synced_i_size: ui_size is 4, synced_i_size is 0, but inode is clean UBIFS error (ubi0:0 pid 1896): dbg_check_synced_i_size: i_ino 65, i_mode 0x81a4, i_size 4 Cc: Fixes: 1e51764a3c2a ("UBIFS: add new flash file system") Signed-off-by: Richard Weinberger Signed-off-by: Greg Kroah-Hartman --- fs/ubifs/journal.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -656,6 +656,11 @@ int ubifs_jnl_update(struct ubifs_info * spin_lock(&ui->ui_lock); ui->synced_i_size = ui->ui_size; spin_unlock(&ui->ui_lock); + if (xent) { + spin_lock(&host_ui->ui_lock); + host_ui->synced_i_size = host_ui->ui_size; + spin_unlock(&host_ui->ui_lock); + } mark_inode_clean(c, ui); mark_inode_clean(c, host_ui); return 0;