Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1061604ybl; Tue, 3 Dec 2019 00:43:16 -0800 (PST) X-Google-Smtp-Source: APXvYqyI1HLGkbG7YIOgoL0qPm0znEnPlZ/0xzW83JuZ2YjHVe+VjZKZFd5JGYW6NQe3DFsX2HpN X-Received: by 2002:aca:4106:: with SMTP id o6mr2697588oia.173.1575362596741; Tue, 03 Dec 2019 00:43:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575362596; cv=none; d=google.com; s=arc-20160816; b=wwtxjn+jUl0UkmhFWWoB5xU3Y9QLcJLvDDzgxzYons9S30RTDn74924j3l2CTjcVeC xcq5dbq8FL51Fea1zO7zgA7nGlO2lJkMgF/0C7wD67Ap4mwt86ukXhgP4p3Mh0ex8t65 4qFL5FW4zAt9VyjMlOCB4UWrh932BvF6bE4jY8MfcR8mOM/djeZQs7hYeFv2T4RtxO5X aXvfCFo1HEMBREWcH5JtQIBVMjWz2hY+5X1HighpY9hSIjW88l42KCROzwDD9k5kJs4y KuzY67iLw0lmET46MstzOFlksHMWYFGgvazSxbUx5N6qk61JFnFRNuEiGDcBX6bziVVt uQpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ZBxnd4WwHhBA6LxgxTN04AAYrQtJo4fVLiQhy5ZZRUc=; b=x78PoNiw+7+bH3GzT/6riFhzGekLB1c8j3ecyud1NDO5ncrPBVPZ1n65Ma04YQZ90k vvn3UQGRhFMyaJSDziv6LdWD5Te5eR1fKb2F47cmbUTm9Nzvk0M0EOp+eoRyw1uR6YA8 535OZ1ituyMlczyOYxDUuZoqCae2tQ0aZAjpLDNH28lTlPWbtAbzfeNTYaab5JZhcIJT pNBXp6G2XX7wycpBXPRHCdzYhGaj81ASlRSSvY2XNJEPuOZWfxbeuLIVQdZnPJqmKD6E kimzW+wgrWYYv7bkaB4nBFeH+I49kgxrq9SLg7x1GH76aZZbmEUnoDxdiXGTIaKAd+kE IkMg== 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 m23si1003165oie.180.2019.12.03.00.43.05; Tue, 03 Dec 2019 00:43:16 -0800 (PST) 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 S1726131AbfLCIlh (ORCPT + 99 others); Tue, 3 Dec 2019 03:41:37 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:32921 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbfLCIlh (ORCPT ); Tue, 3 Dec 2019 03:41:37 -0500 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ic3kV-0004nh-KB; Tue, 03 Dec 2019 09:41:35 +0100 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1ic3kU-000288-NI; Tue, 03 Dec 2019 09:41:34 +0100 Date: Tue, 3 Dec 2019 09:41:34 +0100 From: Sascha Hauer To: Naga Sureshkumar Relli Cc: Richard Weinberger , Miquel Raynal , "linux-kernel@vger.kernel.org" , "linux-mtd@lists.infradead.org" , Michal Simek , "siva.durga.paladugu@xililnx.com" Subject: Re: ubifs mount failure Message-ID: <20191203084134.tgzir4mtekpm5xbs@pengutronix.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 09:38:04 up 148 days, 14:48, 142 users, load average: 0.14, 0.18, 0.18 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Dec 03, 2019 at 04:52:32AM +0000, Naga Sureshkumar Relli wrote: > Hi, > >   > > We have upgraded our Linux kernel to 5.4 from 4.19. > > And I tried mounting ubifs using this kernel on NAND partition with below > command and saw that > > There is an issue with memory allocation. > > #mount -t ubifs ubi0:data /mnt/ > > mount: mounting ubi0:data on /mnt/ failed: Cannot allocate memory > >   > > I saw that there is a commit on fs/ubifs/sb.c, where it is allocating all > the required memories at one shot. > > [1]https://lkml.org/lkml/2018/9/7/724 > > By reverting the above patch, I am able to mount successfully the ubifs. > > By reverting this patch, we are allocating, writing and freeing in a > manner such that, we don’t see memory allocation issues. Sorry, I can't see how this patch causes failing memory allocations. And no, this is not expected. Could you sprinkle some printks and track down where it fails? Is it the obvious place here: if (!sup || !mst || !idx || !ino || !cs) { err = -ENOMEM; goto out; } If yes, which allocation fails and how much memory did we try to allocate? If no, where does it fail? Also, where are you using UBIFS. Is it NAND flash or NOR flash? Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |