Skip to contentSkip to conversation

xfs_mkfs: Do not discard if '-N' is provided

PATCH Superseded Lukas Czerner 3 participants 4 messages Feb 12, 2013 – Feb 14, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_mkfs: Do not discard if '-N' is provided

When '-N' is specified we really should not write anything to the device, neither we should attempt to discard the device.

This commit fixes xfs_mkfs to not attempt to discard the device in the case user specified '-N' flag.

---
 mkfs/xfs_mkfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mkfs/xfs_mkfs.c +1 -1
index a889620..95e27e0 100644
@@ -2010,7 +2010,7 @@ _("block size %d cannot be smaller than logical sector size %d\n"),
 			exit(1);
 		}
 
-	if (discard) {
+	if (discard && !Nflag) {
 		discard_blocks(xi.ddev, xi.dsize);
 		if (xi.rtdev)
 			discard_blocks(xi.rtdev, xi.rtsize);
Signature · 6 lines
1.7.7.6

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw
Quoted 5 lines · Lukas Czerner

When '-N' is specified we really should not write anything to the device, neither we should attempt to discard the device.

This commit fixes xfs_mkfs to not attempt to discard the device in the case user specified '-N' flag.

Thanks, and yes - ouch, this shouldn't happen with -N, that's bad!

But it doesn't look like this is against the current git tree, it applies only with a lot of fuzz & offsets.

-Eric

Quoted 11 lines
---
 mkfs/xfs_mkfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mkfs/xfs_mkfs.c +0 -0
index a889620..95e27e0 100644

mkfs/xfs_mkfs.c _("block size %d cannot be smaller than logical sector size %d\n"), · line 2016

Quoted 8 lines
mkfs/xfs_mkfs.c +1 -1
@@ -2010,7 +2010,7 @@ _("block size %d cannot be smaller than logical sector size %d\n"),
 			exit(1);
 		}
 
-	if (discard) {
+	if (discard && !Nflag) {
 		discard_blocks(xi.ddev, xi.dsize);
 		if (xi.rtdev)
 			discard_blocks(xi.rtdev, xi.rtsize);

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
Quoted 10 lines · Eric Sandeen

Date: Tue, 12 Feb 2013 09:11:38 -0600
From: Eric Sandeen <[email protected]>
To: Lukas Czerner <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] xfs_mkfs: Do not discard if '-N' is provided

Quoted 3 lines · Lukas Czerner

When '-N' is specified we really should not write anything to the device, neither we should attempt to discard the device.

Quoted 7 lines
Quoted 2 lines

This commit fixes xfs_mkfs to not attempt to discard the device in the case user specified '-N' flag.

Thanks, and yes - ouch, this shouldn't happen with -N, that's bad!

But it doesn't look like this is against the current git tree, it applies only with a lot of fuzz & offsets.

Ah, I've been using

git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git

and I can remember that it's not the first time I've realized that I am using wrong repo. Obviously i am not paying a lot of attention to the xfs channel, but does this keep changing, or is it just me ? :)

Will resend the patch based on the

git://oss.sgi.com/xfs/cmds/xfsprogs.git

thanks Eric!

-Lukas

Quoted 16 lines

-Eric

Quoted 13 lines
---
 mkfs/xfs_mkfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mkfs/xfs_mkfs.c +0 -0
index a889620..95e27e0 100644
@@ -2010,7 +2010,7 @@ _("block size %d cannot be smaller than logical sector size %d\n"),
 			exit(1);
 		}
 
Quoted 8 lines

mkfs/xfs_mkfs.c _("block size %d cannot be smaller than logical sector size %d\n"), · line 2016

Quoted 6 lines
mkfs/xfs_mkfs.c +1 -1
-	if (discard) {
+	if (discard && !Nflag) {
 		discard_blocks(xi.ddev, xi.dsize);
 		if (xi.rtdev)
 			discard_blocks(xi.rtdev, xi.rtsize);

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw

Hey Lukas,

Quoted 20 lines · Lukáš Czerner
Quoted 10 lines · Eric Sandeen

Date: Tue, 12 Feb 2013 09:11:38 -0600
From: Eric Sandeen <[email protected]>
To: Lukas Czerner <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] xfs_mkfs: Do not discard if '-N' is provided

Quoted 3 lines · Lukas Czerner

When '-N' is specified we really should not write anything to the device, neither we should attempt to discard the device.

Quoted 7 lines
Quoted 2 lines

This commit fixes xfs_mkfs to not attempt to discard the device in the case user specified '-N' flag.

Thanks, and yes - ouch, this shouldn't happen with -N, that's bad!

But it doesn't look like this is against the current git tree, it applies only with a lot of fuzz & offsets.

Quoted 7 lines

Ah, I've been using

git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git

and I can remember that it's not the first time I've realized that I am using wrong repo. Obviously i am not paying a lot of attention to the xfs channel, but does this keep changing, or is it just me ? :)

It changed just twice, AFAIK.

Christoph, could you clean up the kernel.org trees to help resolve the confusion?

Quoted 3 lines

Will resend the patch based on the

git://oss.sgi.com/xfs/cmds/xfsprogs.git

This is the right place, thanks.

Regards,
Ben

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs