* [PATCH] fs: Don't return 0 from get_anon_bdev
[not found] <20140403191617.GB2472@mtj.dyndns.org>
@ 2014-04-03 19:49 ` Thomas Bächler
2014-04-03 19:51 ` Tejun Heo
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Thomas Bächler @ 2014-04-03 19:49 UTC (permalink / raw)
To: tj
Cc: d, linux-kernel, gregkh, P, alexandre.f.demers,
Thomas Bächler, 3.14
Commit 9e30cc9595303b27b48 removed an internal mount. This
has the side-effect that rootfs now has FSID 0. Many
userspace utilities assume that st_dev in struct stat
is never 0, so this change breaks a number of tools in
early userspace.
Since we don't know how many userspace programs are affected,
make sure that FSID is at least 1.
References: http://article.gmane.org/gmane.linux.kernel/1666905
References: http://permalink.gmane.org/gmane.linux.utilities.util-linux-ng/8557
Cc: 3.14 <stable@vger.kernel.org>
Signed-off-by: Thomas Bächler <thomas@archlinux.org>
---
fs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/super.c b/fs/super.c
index 80d5cf2..d9fddde 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -802,7 +802,7 @@ void emergency_remount(void)
static DEFINE_IDA(unnamed_dev_ida);
static DEFINE_SPINLOCK(unnamed_dev_lock);/* protects the above */
-static int unnamed_dev_start = 0; /* don't bother trying below it */
+static int unnamed_dev_start = 1; /* don't bother trying below it */
int get_anon_bdev(dev_t *p)
{
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] fs: Don't return 0 from get_anon_bdev
2014-04-03 19:49 ` [PATCH] fs: Don't return 0 from get_anon_bdev Thomas Bächler
@ 2014-04-03 19:51 ` Tejun Heo
2014-04-03 19:55 ` [PATCHv2] " Thomas Bächler
2014-04-03 20:21 ` [PATCH] " H. Peter Anvin
2014-04-03 23:41 ` Alexandre Demers
2 siblings, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2014-04-03 19:51 UTC (permalink / raw)
To: Thomas Bächler; +Cc: d, linux-kernel, gregkh, P, alexandre.f.demers, 3.14
On Thu, Apr 03, 2014 at 09:49:55PM +0200, Thomas B�chler wrote:
> Commit 9e30cc9595303b27b48 removed an internal mount. This
> has the side-effect that rootfs now has FSID 0. Many
> userspace utilities assume that st_dev in struct stat
> is never 0, so this change breaks a number of tools in
> early userspace.
>
> Since we don't know how many userspace programs are affected,
> make sure that FSID is at least 1.
>
> References: http://article.gmane.org/gmane.linux.kernel/1666905
> References: http://permalink.gmane.org/gmane.linux.utilities.util-linux-ng/8557
> Cc: 3.14 <stable@vger.kernel.org>
> Signed-off-by: Thomas B�chler <thomas@archlinux.org>
Provided Alexandre confirms the fix.
Acked-by: Tejun Heo <tj@kernel.org>
> ---
> fs/super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/super.c b/fs/super.c
> index 80d5cf2..d9fddde 100644
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -802,7 +802,7 @@ void emergency_remount(void)
>
> static DEFINE_IDA(unnamed_dev_ida);
> static DEFINE_SPINLOCK(unnamed_dev_lock);/* protects the above */
> -static int unnamed_dev_start = 0; /* don't bother trying below it */
> +static int unnamed_dev_start = 1; /* don't bother trying below it */
Maybe a comment saying that userland considers fsid 0 to be invalid
would be nice?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCHv2] fs: Don't return 0 from get_anon_bdev
2014-04-03 19:51 ` Tejun Heo
@ 2014-04-03 19:55 ` Thomas Bächler
2014-04-03 20:32 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Bächler @ 2014-04-03 19:55 UTC (permalink / raw)
To: tj
Cc: d, linux-kernel, gregkh, P, alexandre.f.demers,
Thomas Bächler, 3.14
Commit 9e30cc9595303b27b48 removed an internal mount. This
has the side-effect that rootfs now has FSID 0. Many
userspace utilities assume that st_dev in struct stat
is never 0, so this change breaks a number of tools in
early userspace.
Since we don't know how many userspace programs are affected,
make sure that FSID is at least 1.
References: http://article.gmane.org/gmane.linux.kernel/1666905
References: http://permalink.gmane.org/gmane.linux.utilities.util-linux-ng/8557
Cc: 3.14 <stable@vger.kernel.org>
Signed-off-by: Thomas Bächler <thomas@archlinux.org>
---
fs/super.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/super.c b/fs/super.c
index 80d5cf2..7624267 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -802,7 +802,10 @@ void emergency_remount(void)
static DEFINE_IDA(unnamed_dev_ida);
static DEFINE_SPINLOCK(unnamed_dev_lock);/* protects the above */
-static int unnamed_dev_start = 0; /* don't bother trying below it */
+/* Many userspace utilities consider an FSID of 0 invalid.
+ * Always return at least 1 from get_anon_bdev.
+ */
+static int unnamed_dev_start = 1;
int get_anon_bdev(dev_t *p)
{
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] fs: Don't return 0 from get_anon_bdev
2014-04-03 19:49 ` [PATCH] fs: Don't return 0 from get_anon_bdev Thomas Bächler
2014-04-03 19:51 ` Tejun Heo
@ 2014-04-03 20:21 ` H. Peter Anvin
2014-04-03 23:41 ` Alexandre Demers
2 siblings, 0 replies; 6+ messages in thread
From: H. Peter Anvin @ 2014-04-03 20:21 UTC (permalink / raw)
To: Thomas Bächler, tj
Cc: d, linux-kernel, gregkh, P, alexandre.f.demers, 3.14
On 04/03/2014 12:49 PM, Thomas Bächler wrote:
> Commit 9e30cc9595303b27b48 removed an internal mount. This
> has the side-effect that rootfs now has FSID 0. Many
> userspace utilities assume that st_dev in struct stat
> is never 0, so this change breaks a number of tools in
> early userspace.
>
> Since we don't know how many userspace programs are affected,
> make sure that FSID is at least 1.
>
> References: http://article.gmane.org/gmane.linux.kernel/1666905
> References: http://permalink.gmane.org/gmane.linux.utilities.util-linux-ng/8557
> Cc: 3.14 <stable@vger.kernel.org>
> Signed-off-by: Thomas Bächler <thomas@archlinux.org>
> ---
> fs/super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Acked-by: H. Peter Anvin <hpa@zytor.com>
It is worth noting that zero has been documented as a null device number
since at least 1995, probably more like 1993.
-hpa
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCHv2] fs: Don't return 0 from get_anon_bdev
2014-04-03 19:55 ` [PATCHv2] " Thomas Bächler
@ 2014-04-03 20:32 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2014-04-03 20:32 UTC (permalink / raw)
To: Thomas Bächler; +Cc: tj, d, linux-kernel, P, alexandre.f.demers, 3.14
On Thu, Apr 03, 2014 at 09:55:37PM +0200, Thomas B�chler wrote:
> Commit 9e30cc9595303b27b48 removed an internal mount. This
> has the side-effect that rootfs now has FSID 0. Many
> userspace utilities assume that st_dev in struct stat
> is never 0, so this change breaks a number of tools in
> early userspace.
>
> Since we don't know how many userspace programs are affected,
> make sure that FSID is at least 1.
>
> References: http://article.gmane.org/gmane.linux.kernel/1666905
> References: http://permalink.gmane.org/gmane.linux.utilities.util-linux-ng/8557
> Cc: 3.14 <stable@vger.kernel.org>
> Signed-off-by: Thomas B�chler <thomas@archlinux.org>
> ---
> fs/super.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/super.c b/fs/super.c
> index 80d5cf2..7624267 100644
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -802,7 +802,10 @@ void emergency_remount(void)
>
> static DEFINE_IDA(unnamed_dev_ida);
> static DEFINE_SPINLOCK(unnamed_dev_lock);/* protects the above */
> -static int unnamed_dev_start = 0; /* don't bother trying below it */
> +/* Many userspace utilities consider an FSID of 0 invalid.
> + * Always return at least 1 from get_anon_bdev.
> + */
> +static int unnamed_dev_start = 1;
>
> int get_anon_bdev(dev_t *p)
> {
Very nice, I'll go queue this one up instead of the other patch from
Tejun.
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fs: Don't return 0 from get_anon_bdev
2014-04-03 19:49 ` [PATCH] fs: Don't return 0 from get_anon_bdev Thomas Bächler
2014-04-03 19:51 ` Tejun Heo
2014-04-03 20:21 ` [PATCH] " H. Peter Anvin
@ 2014-04-03 23:41 ` Alexandre Demers
2 siblings, 0 replies; 6+ messages in thread
From: Alexandre Demers @ 2014-04-03 23:41 UTC (permalink / raw)
To: Thomas Bächler, tj; +Cc: d, linux-kernel, gregkh, P, 3.14
It works over here, tested on 3.14-rc8 which was previously failing. You
have my
Tested-by: Alexandre Demers
Alexandre Demers
On 04/03/2014 03:49 PM, Thomas Bächler wrote:
> Commit 9e30cc9595303b27b48 removed an internal mount. This
> has the side-effect that rootfs now has FSID 0. Many
> userspace utilities assume that st_dev in struct stat
> is never 0, so this change breaks a number of tools in
> early userspace.
>
> Since we don't know how many userspace programs are affected,
> make sure that FSID is at least 1.
>
> References: http://article.gmane.org/gmane.linux.kernel/1666905
> References: http://permalink.gmane.org/gmane.linux.utilities.util-linux-ng/8557
> Cc: 3.14 <stable@vger.kernel.org>
> Signed-off-by: Thomas Bächler <thomas@archlinux.org>
> ---
> fs/super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/super.c b/fs/super.c
> index 80d5cf2..d9fddde 100644
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -802,7 +802,7 @@ void emergency_remount(void)
>
> static DEFINE_IDA(unnamed_dev_ida);
> static DEFINE_SPINLOCK(unnamed_dev_lock);/* protects the above */
> -static int unnamed_dev_start = 0; /* don't bother trying below it */
> +static int unnamed_dev_start = 1; /* don't bother trying below it */
>
> int get_anon_bdev(dev_t *p)
> {
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-04-03 23:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20140403191617.GB2472@mtj.dyndns.org>
2014-04-03 19:49 ` [PATCH] fs: Don't return 0 from get_anon_bdev Thomas Bächler
2014-04-03 19:51 ` Tejun Heo
2014-04-03 19:55 ` [PATCHv2] " Thomas Bächler
2014-04-03 20:32 ` Greg KH
2014-04-03 20:21 ` [PATCH] " H. Peter Anvin
2014-04-03 23:41 ` Alexandre Demers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).