Re: LVM & fstrim behaviour (Fedora 19)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 24 Sep 2013, Jorge Fábregas wrote:

> Date: Tue, 24 Sep 2013 14:03:12 -0400
> From: Jorge Fábregas <jorge.fabregas@gmail.com>
> To: linux-lvm@redhat.com
> Cc: Lukáš Czerner <lczerner@redhat.com>
> Subject: Re:  LVM & fstrim behaviour (Fedora 19)
> 
> ok Lukáš I think I found where the problem is. I just realized that I
> created that filesystem without journaling (in order to increase perform
> for the VM disks).  I created it with:
> 
> mkfs.ext4 -O ^has_journal /dev/vgthin1/lvol2
> 
> I went back and created the filesystem again (on a thin lvol) with
> default options and indeed fstrim works as expected.  I created ANOTHER
> thinvol (without journaling) and fstrim doesn't work.
> 
> Is this a bug or does fstrim requires ext4 with journal by design?

Oh that's useful information :) Yes, it is a bug and here is
untested fix.


diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index a41e3ba..4d113ef 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -4794,8 +4794,8 @@ do_more:
 					 " group:%d block:%d count:%lu failed"
 					 " with %d", block_group, bit, count,
 					 err);
-		}
-
+		} else
+			EXT4_MB_GRP_CLEAR_TRIMMED(e4b.bd_info);
 
 		ext4_lock_group(sb, block_group);
 		mb_clear_bits(bitmap_bh->b_data, bit, count_clusters);

> 
> My apologies for not stating this since the beginning!

No problem, important is that we've got to the bottom of this.
Thanks for reporting it!

-Lukas

> 
> 
_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux