From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x226X/9ZBHP5/SP3NwbSO1M/li8/g2NLHyS92f7jYmW361pw8wZKmZydMFpBZPBWtovrD7CWC ARC-Seal: i=1; a=rsa-sha256; t=1517256911; cv=none; d=google.com; s=arc-20160816; b=EmUyDL0HXI5k6JLaszKVGodIcH1YSap+Cov35+SHhjPr6JQsUtyqPSKBW6k/So0ikS y0heGUZPetqFYNRfHtq4Win5fbbg6syrTQGES45eO/A7cJCWO07O9/NNW+SzlZP0EzXF 07iKy8ixUofYb/TzN1tba6aLXABhi889syV+81P0OyQGYZHEszYip9PFCCYPm8sUeK77 cY3bP31E+zKb9LMDAPGL8ZlVmhz/gTRgIWGrOzl0meDypUiXyqj44c5dNQY4Gl8zxZrP YTiQzTgH8VEWELmzkP98XyItnQCKFSecbCy3RavQLqcqVu2sn+9DSAYdj4eBduUTZc+h YJCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=p6hI8d3gQo4HjMQ77ZGs7gB0p/JvD/uCK7SoQ3y958s=; b=AHmMUk+T2lqnmuN+X3LHm8a8Bn1l5HjTzXo1UriHT9WKMVnmChLj5jlFZdOQjQWyAl k/qJi79OaCK8ZTM2FGqJymPzWoYIv3xHwLiYu5v7jZML0rA9+YJU3jhAeTBuwzlLdPjU l4Kw3ZpGHaKgb1HBITpSQDd+tjCo553Lu/ITQSGgw4KMVIDRixWlct44TWOAh9mylyRV L7Ja9LLzvBJXEowyMvF98EnHyyz8VtrdPgPeDo2MyNHdoMlfAaSP7Myqu05IofY9XCrN xZKG7Z36LAB5wNEt23lM5KotfGVDOzyYIqsSFBY/y5kZowxFev23xET9Qk05BNI2x3zy pahQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeff Mahoney , Jan Kara Subject: [PATCH 4.4 43/74] reiserfs: dont preallocate blocks for extended attributes Date: Mon, 29 Jan 2018 13:56:48 +0100 Message-Id: <20180129123849.521296639@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123847.507563674@linuxfoundation.org> References: <20180129123847.507563674@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590931756641199605?= X-GMAIL-MSGID: =?utf-8?q?1590959182598020112?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jeff Mahoney commit 54930dfeb46e978b447af0fb8ab4e181c1bf9d7a upstream. Most extended attributes will fit in a single block. More importantly, we drop the reference to the inode while holding the transaction open so the preallocated blocks aren't released. As a result, the inode may be evicted before it's removed from the transaction's prealloc list which can cause memory corruption. Signed-off-by: Jeff Mahoney Signed-off-by: Jan Kara Signed-off-by: Greg Kroah-Hartman --- fs/reiserfs/bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/reiserfs/bitmap.c +++ b/fs/reiserfs/bitmap.c @@ -1136,7 +1136,7 @@ static int determine_prealloc_size(reise hint->prealloc_size = 0; if (!hint->formatted_node && hint->preallocate) { - if (S_ISREG(hint->inode->i_mode) + if (S_ISREG(hint->inode->i_mode) && !IS_PRIVATE(hint->inode) && hint->inode->i_size >= REISERFS_SB(hint->th->t_super)->s_alloc_options. preallocmin * hint->inode->i_sb->s_blocksize)