mkfs: Remove messages printed when blocksize < physical sectorsize
PATCH 1/1 mkfs: Remove messages printed when blocksize < physical sectorsize
Linux kernel commit 6c6b6f28b3335fd85ec833ee0005d9c9dca6c003 (loop: set physical block size to PAGE_SIZE) now sets PAGE_SIZE as the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.
With these changes, mkfs.xfs now prints error messages when filesystem blocksize (4k) is less than underlying device's physical sectorsize (64k). These messages (printed on stderr) now cause several xfstests to fail on ppc64 machine since xfstests' _filter_mkfs() isn't able to filter out stderr.
Also, the messages themselves describe a possible sub-optimal setup. But the setup is still usable.
Hence this commit removes the calls to fprintf() used to print the messages.
--- mkfs/xfs_mkfs.c | 6 ------ 1 file changed, 6 deletions(-)
mkfs/xfs_mkfs.c +0 -6
@@ -2011,12 +2011,6 @@ _("Minimum block size for CRC enabled filesystems is %d bytes.\n"),XFS_MIN_SECTORSIZE ;if ((blocksize < sectorsize) && (blocksize >= ft.lsectorsize)) { -fprintf (stderr, -_ ("specified blocksize %d is less than device physical sector size %d\n" ), - blocksize, ft.psectorsize); -fprintf (stderr, -_ ("switching to logical sector size %d\n" ), - ft.lsectorsize); sectorsize = ft.lsectorsize ? ft.lsectorsize :XFS_MIN_SECTORSIZE ; }
Signature · 1 line
2.9.5
Quoted 4 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.
Eek. We'll need to revert the loop change ASAP!
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.Eek. We'll need to revert the loop change ASAP!
Most annoying patch series ever. It hasn't made it to Linus' tree yet, right? We can revert (although the later change depends on that), fold in a fix, or apply a fix on top of it, whatever Jens prefers.
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.Eek. We'll need to revert the loop change ASAP!
And, FWIW, making the warning go away if probably a bad idea, because XFS only supports devices with sector sizes up to 32k:
#define XFS_MIN_SECTORSIZE_LOG 9 /* i.e. 512 bytes */ #define XFS_MAX_SECTORSIZE_LOG 15 /* i.e. 32768 bytes */
And so it should be warning about devices trying to tell it to use something larger....
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 7 lines · IST Omar Sandoval
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.
Quoted 7 lines
Quoted 1 line
Eek. We'll need to revert the loop change ASAP!
Most annoying patch series ever. It hasn't made it to Linus' tree yet, right? We can revert (although the later change depends on that), fold in a fix, or apply a fix on top of it, whatever Jens prefers.
My bad. 6c6b6f28b3335fd85ec833ee0005d9c9dca6c003 is the commit id from Linux-next. I don't see this commit in Linus's git tree.
Signature · 1 line
chandan
Quoted 7 lines · Dave Chinner
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.
Quoted 5 lines
Quoted 1 line
Eek. We'll need to revert the loop change ASAP!
And, FWIW, making the warning go away if probably a bad idea, because XFS only supports devices with sector sizes up to 32k:
Well, TBH removing this warning was my suggestion, because it's automatically fixing values that weren't specified by the user in the first place. First preference is physical sector size, then fallback to logical but it doesn't need to be noisy about it.
Quoted 5 lines
#define XFS_MIN_SECTORSIZE_LOG 9 /* i.e. 512 bytes */ #define XFS_MAX_SECTORSIZE_LOG 15 /* i.e. 32768 bytes */And so it should be warning about devices trying to tell it to use something larger....
As long as the logical sector size is small enough, it seems like a silent adjustment is probably ok, no?
-Eric
Quoted 4 lines
Cheers,
Dave.
Jens Axboe
maintainerQuoted 10 lines · Chandan Rajendra
Quoted 9 lines · IST Omar Sandoval
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.Eek. We'll need to revert the loop change ASAP!
Quoted 8 lines
Quoted 5 lines
Most annoying patch series ever. It hasn't made it to Linus' tree yet, right? We can revert (although the later change depends on that), fold in a fix, or apply a fix on top of it, whatever Jens prefers.
My bad.
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003is the commit id from Linux-next. I don't see this commit in Linus's git tree.
Right, it's only queued up, and scheduled for the 2nd part of the block changes for 4.14. It should have been PAGE_CACHE_SIZE, but we don't have that anymore...
Omar, are you sending a patch to fix this up?
Signature · 1 line
Jens Axboe
Quoted 17 lines · Jens Axboe
Quoted 16 lines · Chandan Rajendra
Quoted 14 lines · IST Omar Sandoval
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.Eek. We'll need to revert the loop change ASAP!
Most annoying patch series ever. It hasn't made it to Linus' tree yet, right? We can revert (although the later change depends on that), fold in a fix, or apply a fix on top of it, whatever Jens prefers.
Quoted 6 lines
Quoted 2 lines
My bad.
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003is the commit id from Linux-next. I don't see this commit in Linus's git tree.Right, it's only queued up, and scheduled for the 2nd part of the block changes for 4.14. It should have been
PAGE_CACHE_SIZE, but we don't have that anymore...
But PAGE_CACHE_SIZE was equal to PAGE_SIZE, so that would have been wrong, too.
I just don't see why this is necessary, given that buffered IO through the upper filesystem will already be doing page sized/aligned IO where possible (because that's what the page cache does!). And for direct IO the loop device should just export the underlying host filesystem logical/physical sector sizes, which should be optimal for the backing storage to begin with.
Someone want to enlighten me as to what problem is being solved here?
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 21 lines · Eric Sandeen
Quoted 7 lines · Dave Chinner
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.Quoted 5 lines
Quoted 1 line
Eek. We'll need to revert the loop change ASAP!
And, FWIW, making the warning go away if probably a bad idea, because XFS only supports devices with sector sizes up to 32k:
Well, TBH removing this warning was my suggestion, because it's automatically fixing values that weren't specified by the user in the first place. First preference is physical sector size, then fallback to logical but it doesn't need to be noisy about it.
Quoted 8 lines
Quoted 5 lines
#define XFS_MIN_SECTORSIZE_LOG 9 /* i.e. 512 bytes */ #define XFS_MAX_SECTORSIZE_LOG 15 /* i.e. 32768 bytes */And so it should be warning about devices trying to tell it to use something larger....
As long as the logical sector size is small enough, it seems like a silent adjustment is probably ok, no?
Think 512e drives. Doing 512 byte sector IO is possible, but slow. Someone might actually want to avoid that by having the filesystem use 4k sector sizes. However, if for some reason, mkfs selects 512 byte sectors (the logical size) rather than 4k sector size, then shouldn't we be telling the user we're doing something that has a "for-the-life-of-the-filesystem" performance impact?
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 31 lines · Dave Chinner
Quoted 21 lines · Eric Sandeen
Quoted 7 lines · Dave Chinner
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.Quoted 5 lines
Quoted 1 line
Eek. We'll need to revert the loop change ASAP!
And, FWIW, making the warning go away if probably a bad idea, because XFS only supports devices with sector sizes up to 32k:
Well, TBH removing this warning was my suggestion, because it's automatically fixing values that weren't specified by the user in the first place. First preference is physical sector size, then fallback to logical but it doesn't need to be noisy about it.
Quoted 8 lines
Quoted 5 lines
#define XFS_MIN_SECTORSIZE_LOG 9 /* i.e. 512 bytes */ #define XFS_MAX_SECTORSIZE_LOG 15 /* i.e. 32768 bytes */And so it should be warning about devices trying to tell it to use something larger....
As long as the logical sector size is small enough, it seems like a silent adjustment is probably ok, no?
Quoted 6 lines
Think 512e drives. Doing 512 byte sector IO is possible, but slow. Someone might actually want to avoid that by having the filesystem use 4k sector sizes. However, if for some reason, mkfs selects 512 byte sectors (the logical size) rather than 4k sector size, then shouldn't we be telling the user we're doing something that has a "for-the-life-of-the-filesystem" performance impact?
Well, sure, but it'll only select 512 if it /has/ to, i.e. if the block size is < 4k.
So for the simple case of a 512e drive, our default block size is 4k, physical size is 4k, and everything is happy and fine.
If the user /specifies/ a 1k block size on such a device, how much of a nanny do we really want to be about telling them this is suboptimal?
There are a lot of suboptimal things you can specify on the mkfs commandline, but we don't generally choose to warn about them...
-Eric
Quoted 4 lines
Cheers,
Dave.
Quoted 35 lines · Dave Chinner
Quoted 17 lines · Jens Axboe
Quoted 16 lines · Chandan Rajendra
Quoted 14 lines · IST Omar Sandoval
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.Eek. We'll need to revert the loop change ASAP!
Most annoying patch series ever. It hasn't made it to Linus' tree yet, right? We can revert (although the later change depends on that), fold in a fix, or apply a fix on top of it, whatever Jens prefers.
Quoted 6 lines
Quoted 2 lines
My bad.
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003is the commit id from Linux-next. I don't see this commit in Linus's git tree.Right, it's only queued up, and scheduled for the 2nd part of the block changes for 4.14. It should have been
PAGE_CACHE_SIZE, but we don't have that anymore...But
PAGE_CACHE_SIZEwas equal toPAGE_SIZE, so that would have been wrong, too.I just don't see why this is necessary, given that buffered IO through the upper filesystem will already be doing page sized/aligned IO where possible (because that's what the page cache does!). And for direct IO the loop device should just export the underlying host filesystem logical/physical sector sizes, which should be optimal for the backing storage to begin with.
Quoted 2 lines
Someone want to enlighten me as to what problem is being solved here?
I already sent a patch to fix this:
https://marc.info/?l=linux-block&m=150464670510301&w=2
Loop was using the default physical block size of 512, which is a lie according to the definition of the physical block size:
/**
* blk_queue_physical_block_size - set physical block size for the queue
* @q: the request queue for the device
* @size: the physical block size, in bytes
*
* Description:
* This should be set to the lowest possible sector size that the * hardware can operate on without reverting to read-modify-write * operations.
*/
Clearly for buffered loop devices, this unit is a page. The change was pedantic, so whatever, my patch above makes things backwards compatible.
Quoted 36 lines · Omar Sandoval
Quoted 35 lines · Dave Chinner
Quoted 17 lines · Jens Axboe
Quoted 16 lines · Chandan Rajendra
Quoted 14 lines · IST Omar Sandoval
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.Eek. We'll need to revert the loop change ASAP!
Most annoying patch series ever. It hasn't made it to Linus' tree yet, right? We can revert (although the later change depends on that), fold in a fix, or apply a fix on top of it, whatever Jens prefers.
Quoted 6 lines
Quoted 2 lines
My bad.
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003is the commit id from Linux-next. I don't see this commit in Linus's git tree.Right, it's only queued up, and scheduled for the 2nd part of the block changes for 4.14. It should have been
PAGE_CACHE_SIZE, but we don't have that anymore...But
PAGE_CACHE_SIZEwas equal toPAGE_SIZE, so that would have been wrong, too.I just don't see why this is necessary, given that buffered IO through the upper filesystem will already be doing page sized/aligned IO where possible (because that's what the page cache does!). And for direct IO the loop device should just export the underlying host filesystem logical/physical sector sizes, which should be optimal for the backing storage to begin with.
Quoted 8 lines
Quoted 2 lines
Someone want to enlighten me as to what problem is being solved here?
I already sent a patch to fix this:
https://marc.info/?l=linux-block&m=150464670510301&w=2Loop was using the default physical block size of 512, which is a lie according to the definition of the physical block size:
Loop devices are special. They /have to lie/ because they are the only mechanism we have for mounting image files with sector sizes smaller than the host storage sizes. i.e. loop devices require compatibility and flexibility first and so need to default to "most compatible" behaviour, not "most performant".
If you're really "sick of these stupid changes" then perhaps you should consider cc'ing linux-fsdevel for loop device changes so filesystem developers have a chance to catch these filesystem side problems in new loopdev code before it's merged anywhere....
FWIW, if you're going to set some kind of optimal default for the loop devices then - like all other stacked block devices - the defaults need to be pulled from the underlying storage (i.e. the filesystem that hosts the file) rather than making them up out of thin air.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Quoted 43 lines · Dave Chinner
Quoted 42 lines · Omar Sandoval
Quoted 35 lines · Dave Chinner
Quoted 17 lines · Jens Axboe
Quoted 16 lines · Chandan Rajendra
Quoted 14 lines · IST Omar Sandoval
Quoted 7 lines · Christoph Hellwig
Quoted 4 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.Eek. We'll need to revert the loop change ASAP!
Most annoying patch series ever. It hasn't made it to Linus' tree yet, right? We can revert (although the later change depends on that), fold in a fix, or apply a fix on top of it, whatever Jens prefers.
Quoted 6 lines
Quoted 2 lines
My bad.
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003is the commit id from Linux-next. I don't see this commit in Linus's git tree.Right, it's only queued up, and scheduled for the 2nd part of the block changes for 4.14. It should have been
PAGE_CACHE_SIZE, but we don't have that anymore...But
PAGE_CACHE_SIZEwas equal toPAGE_SIZE, so that would have been wrong, too.I just don't see why this is necessary, given that buffered IO through the upper filesystem will already be doing page sized/aligned IO where possible (because that's what the page cache does!). And for direct IO the loop device should just export the underlying host filesystem logical/physical sector sizes, which should be optimal for the backing storage to begin with.
Quoted 2 lines
Someone want to enlighten me as to what problem is being solved here?
I already sent a patch to fix this:
https://marc.info/?l=linux-block&m=150464670510301&w=2
Quoted 8 lines
Quoted 2 lines
Loop was using the default physical block size of 512, which is a lie according to the definition of the physical block size:
Loop devices are special. They /have to lie/ because they are the only mechanism we have for mounting image files with sector sizes smaller than the host storage sizes. i.e. loop devices require compatibility and flexibility first and so need to default to "most compatible" behaviour, not "most performant".
And that's why the logical block size is 512 by default. The physical block size doesn't have any bearing on what you can do with the device, it's a _hint_ for the application. But again, I'm just being overly pedantic, I should've checked how tools were actually using the physical block size.
Quoted 4 lines
If you're really "sick of these stupid changes" then perhaps you should consider cc'ing linux-fsdevel for loop device changes so filesystem developers have a chance to catch these filesystem side problems in new loopdev code before it's merged anywhere....
Yup, loop changes haven't been going outside of linux-block but at least this one should have gone to fsdevel, sorry.
Quoted 5 lines
FWIW, if you're going to set some kind of optimal default for the loop devices then - like all other stacked block devices - the defaults need to be pulled from the underlying storage (i.e. the filesystem that hosts the file) rather than making them up out of thin air.
Not worth the trouble for now, I'll just leave this alone now.
Quoted 11 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.With these changes, mkfs.xfs now prints error messages when filesystem blocksize (4k) is less than underlying device's physical sectorsize (64k). These messages (printed on stderr) now cause several xfstests to fail on ppc64 machine since xfstests'
_filter_mkfs()isn't able to filter out stderr.
Quoted 5 lines
Also, the messages themselves describe a possible sub-optimal setup. But the setup is still usable.
Hence this commit removes the calls to
fprintf()used to print the messages.
So, it looks like the loop change is getting reverted, right ... still -
Although I suggested this change, I'm rethinking it. I'm not a fan of the warning for a default situation; the user can get this warning with nothing but a bare mkfs, which is not good IMHO.
(dchinner OTOH thinks we should warn about this suboptimal situation in any case - but I really don't think it's mkfs's job to be warning about every suboptimal geometry - there are a lot of them out there!)
What I'd now propose is that we change this warning into a failure, but only if a too-small block size was actually /specified/, i.e. bsflag is set. If we're adjusting sector size based on device geometry and /default/ blocksize, I think we should just shut up about it.
i.e. something like:
if ((blocksize < sectorsize) && (blocksize >= ft.lsectorsize)) {
if (bsflag) {
fprintf(stderr,
_("specified blocksize %d cannot be less than device physical sector size %d\n"),
blocksize, ft.psectorsize);
usage();
}
sectorsize = ft.lsectorsize ? ft.lsectorsize :
XFS_MIN_SECTORSIZE;
}Thoughts?
-Eric
Quoted 23 lines
Signed-off-by Chandan Rajendra <[email protected]>--- mkfs/xfs_mkfs.c | 6 ------ 1 file changed, 6 deletions(-)mkfs/xfs_mkfs.c +0
-6@@ -2011,12 +2011,6 @@ _("Minimum block size for CRC enabled filesystems is %d bytes.\n"),XFS_MIN_SECTORSIZE ;if ((blocksize < sectorsize) && (blocksize >= ft.lsectorsize)) { -fprintf (stderr, -_ ("specified blocksize %d is less than device physical sector size %d\n" ), - blocksize, ft.psectorsize); -fprintf (stderr, -_ ("switching to logical sector size %d\n" ), - ft.lsectorsize); sectorsize = ft.lsectorsize ? ft.lsectorsize :XFS_MIN_SECTORSIZE ; }
Quoted 28 lines · IST Eric Sandeen
Quoted 11 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.With these changes, mkfs.xfs now prints error messages when filesystem blocksize (4k) is less than underlying device's physical sectorsize (64k). These messages (printed on stderr) now cause several xfstests to fail on ppc64 machine since xfstests'
_filter_mkfs()isn't able to filter out stderr.Quoted 5 lines
Also, the messages themselves describe a possible sub-optimal setup. But the setup is still usable.
Hence this commit removes the calls to
fprintf()used to print the messages.So, it looks like the loop change is getting reverted, right ... still -
Although I suggested this change, I'm rethinking it. I'm not a fan of the warning for a default situation; the user can get this warning with nothing but a bare mkfs, which is not good IMHO.
(dchinner OTOH thinks we should warn about this suboptimal situation in any case - but I really don't think it's mkfs's job to be warning about every suboptimal geometry - there are a lot of them out there!)
Quoted 8 lines
What I'd now propose is that we change this warning into a failure, but only if a too-small block size was actually /specified/, i.e. bsflag is set. If we're adjusting sector size based on device geometry and /default/ blocksize, I think we should just shut up about it.
i.e. something like:
if ((blocksize < sectorsize) && (blocksize >= ft.lsectorsize)) {
I agree with your changes from a system administrator's perspective. But without these messages, the sectorsize change for the loop device would most likely not have been noticed.
Quoted 1 line
if (bsflag) {Just FYI, We should also be checking blflag's value.
Quoted 11 lines
fprintf(stderr,
_("specified blocksize %d cannot be less than device physical sector size %d\n"),blocksize, ft.psectorsize); usage(); } sectorsize = ft.lsectorsize ? ft.lsectorsize : XFS_MIN_SECTORSIZE; }Thoughts?
Signature · 1 line
chandan
Quoted 38 lines · Chandan Rajendra
Quoted 28 lines · IST Eric Sandeen
Quoted 11 lines · Chandan Rajendra
Linux kernel commit
6c6b6f28b3335fd85ec833ee0005d9c9dca6c003(loop: set physical block size toPAGE_SIZE) now setsPAGE_SIZEas the default physical sector size of loop devices. On ppc64, this causes loop devices to have 64k as the physical sector size.With these changes, mkfs.xfs now prints error messages when filesystem blocksize (4k) is less than underlying device's physical sectorsize (64k). These messages (printed on stderr) now cause several xfstests to fail on ppc64 machine since xfstests'
_filter_mkfs()isn't able to filter out stderr.Quoted 5 lines
Also, the messages themselves describe a possible sub-optimal setup. But the setup is still usable.
Hence this commit removes the calls to
fprintf()used to print the messages.So, it looks like the loop change is getting reverted, right ... still -
Although I suggested this change, I'm rethinking it. I'm not a fan of the warning for a default situation; the user can get this warning with nothing but a bare mkfs, which is not good IMHO.
(dchinner OTOH thinks we should warn about this suboptimal situation in any case - but I really don't think it's mkfs's job to be warning about every suboptimal geometry - there are a lot of them out there!)
Quoted 8 lines
What I'd now propose is that we change this warning into a failure, but only if a too-small block size was actually /specified/, i.e. bsflag is set. If we're adjusting sector size based on device geometry and /default/ blocksize, I think we should just shut up about it.
i.e. something like:
if ((blocksize < sectorsize) && (blocksize >= ft.lsectorsize)) {
Quoted 7 lines
I agree with your changes from a system administrator's perspective. But without these messages, the sectorsize change for the loop device would most likely not have been noticed.
Quoted 1 line
if (bsflag) {Just FYI, We should also be checking blflag's value.
Just FYI, my mkfs series reworks this piece of code completely so there aren't any flags to check.... :P
And given that we are planning on having config file overrides of default mkfs values, we need to keep this warning even on default configurations because the distro/site specific default blocksize in the config file may trigger this....
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]