All of lore.kernel.org
 help / color / mirror / Atom feed
* ext4 discard does not apper in /proc/mounts
@ 2012-01-07 23:23 Andrei Popa
  2012-01-09 17:12 ` Eric Sandeen
  0 siblings, 1 reply; 3+ messages in thread
From: Andrei Popa @ 2012-01-07 23:23 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, adilger.kernel

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

Hello,

ierdnac-hp ~ # cat /etc/fstab |grep discard
/dev/sda3               /               ext4
discard,noatime,norelatime,barrier=0,errors=remount-ro,data=writeback
0 1

ierdnac-hp ~ # tune2fs -l /dev/sda3|grep discard
Default mount options:    journal_data_writeback discard

ierdnac-hp ~ # cat /proc/mounts |grep write
/dev/root / ext4 rw,noatime,user_xattr,acl,barrier=0,data=writeback 0 0


-- 
Andrei Popa
(+4) 0741.57.80.90


[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4496 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ext4 discard does not apper in /proc/mounts
  2012-01-07 23:23 ext4 discard does not apper in /proc/mounts Andrei Popa
@ 2012-01-09 17:12 ` Eric Sandeen
  2012-01-09 19:23   ` Andrei Popa
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2012-01-09 17:12 UTC (permalink / raw)
  To: andrei.popa; +Cc: linux-ext4

On 1/7/12 5:23 PM, Andrei Popa wrote:
> Hello,
> 
> ierdnac-hp ~ # cat /etc/fstab |grep discard
> /dev/sda3               /               ext4
> discard,noatime,norelatime,barrier=0,errors=remount-ro,data=writeback
> 0 1
> 
> ierdnac-hp ~ # tune2fs -l /dev/sda3|grep discard
> Default mount options:    journal_data_writeback discard
> 
> ierdnac-hp ~ # cat /proc/mounts |grep write
> /dev/root / ext4 rw,noatime,user_xattr,acl,barrier=0,data=writeback 0 0
> 
> 

What kernel?

If it's a recent kernel, here is the logic which controls whether to show it:

        if (test_opt(sb, DISCARD) && !(def_mount_opts & EXT4_DEFM_DISCARD))
                seq_puts(seq, ",discard");

i.e. if "discard" is in the default mount options for the fs, it is not
shown, by design - although I am not 100% sure why that design decision
was made; that logic was explicitly added here:

commit 8b67f04ab9de5d8f3a71aef72bf02c995a506db5
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Sun Aug 1 23:14:20 2010 -0400

    ext4: Add mount options in superblock
    
    Allow mount options to be stored in the superblock.  Also add default
    mount option bits for nobarrier, block_validity, discard, and nodelalloc.
    
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

which contained:

-       if (test_opt(sb, DISCARD))
+       if (test_opt(sb, DISCARD) && !(def_mount_opts & EXT4_DEFM_DISCARD))
                seq_puts(seq, ",discard");

so maybe Ted can speak to the reasoning behind it; I think the general philosophy
is to not show any defaults in /proc/mounts.

Thanks,
-Eric

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ext4 discard does not apper in /proc/mounts
  2012-01-09 17:12 ` Eric Sandeen
@ 2012-01-09 19:23   ` Andrei Popa
  0 siblings, 0 replies; 3+ messages in thread
From: Andrei Popa @ 2012-01-09 19:23 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-ext4

[-- Attachment #1: Type: text/plain, Size: 969 bytes --]

On Mon, 2012-01-09 at 11:12 -0600, Eric Sandeen wrote:
 
> What kernel?

ierdnac-hp ~ # uname -a
Linux ierdnac-hp 3.1.6-pf-c220 #1 SMP PREEMPT Mon Jan 2 12:59:38 EET
2012 x86_64 Intel(R) Core(TM) i3 CPU M 380 @ 2.53GHz GenuineIntel
GNU/Linux

> If it's a recent kernel, here is the logic which controls whether to show it:
> 
>         if (test_opt(sb, DISCARD) && !(def_mount_opts & EXT4_DEFM_DISCARD))
>                 seq_puts(seq, ",discard");
> 
> i.e. if "discard" is in the default mount options for the fs, it is not
> shown, by design - although I am not 100% sure why that design decision
> was made; that logic was explicitly added here:

Indeed:
ierdnac-hp ~ # tune2fs -l /dev/sda3|grep discard
ierdnac-hp ~ # 
ierdnac-hp ~ # cat /proc/mounts |grep discard
/dev/root / ext4 rw,noatime,errors=remount-ro,user_xattr,acl,barrier=0,data=writeback,discard 0 0


Thank you for clarifing this !

-- 
Andrei Popa
(+4) 0741.57.80.90


[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4496 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-09 19:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-07 23:23 ext4 discard does not apper in /proc/mounts Andrei Popa
2012-01-09 17:12 ` Eric Sandeen
2012-01-09 19:23   ` Andrei Popa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.