From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754880AbcEXUYT (ORCPT ); Tue, 24 May 2016 16:24:19 -0400 Received: from mga14.intel.com ([192.55.52.115]:30222 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751420AbcEXUYS (ORCPT ); Tue, 24 May 2016 16:24:18 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,360,1459839600"; d="scan'208";a="987945110" Message-ID: <1464121530.31269.86.camel@linux.intel.com> Subject: Re: [PATCH v1 1/1] sysctl: introduce uuid_le and uuid_be From: Andy Shevchenko To: Andrew Morton Cc: "Theodore Ts'o" , Arnd Bergmann , linux-kernel@vger.kernel.org Date: Tue, 24 May 2016 23:25:30 +0300 In-Reply-To: <20160524131508.7277546c9620a0ad080f1e19@linux-foundation.org> References: <1464110847-41097-1-git-send-email-andriy.shevchenko@linux.intel.com> <20160524131508.7277546c9620a0ad080f1e19@linux-foundation.org> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.2-2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2016-05-24 at 13:15 -0700, Andrew Morton wrote: > On Tue, 24 May 2016 20:27:27 +0300 Andy Shevchenko linux.intel.com> wrote: > > > By default the sysctl interface returns random UUID in big endian > > format. > > Sometimes it's not suitable, e.g. using generated UUID for EFI > > variable name. > > Provide uuid_le and uuid_be to comprehence that interface. > > > > ... > > > >  drivers/char/random.c       | 44 > > +++++++++++++++++++++++++++++++++++++++++ > >  include/uapi/linux/sysctl.h |  4 +++- > >  kernel/sysctl_binary.c      | 48 > > ++++++++++++++++++++++++++++++++++++++++++++ > > Why does the kernel need to do this?  If userspace wants a random uuid > then it can grab a random number and cook up the UUID itself. Good question. I dunno why we have uuid in the first place there. At some point I noticed people who recommend to use that file to get a random UUID(s), but apparently they don't aware that endianess matters.  P.S. I thought to send this as RFC, but decided to drop the notation in last minute. So, it's okay to drop it. -- Andy Shevchenko Intel Finland Oy