linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Skip "rootfs" entry when checking for ext4 filesystem.
@ 2009-09-08 16:13 Eric Sandeen
  2009-10-08 20:14 ` Eric Sandeen
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2009-09-08 16:13 UTC (permalink / raw)
  To: ext4 development; +Cc: ravi

Skip "rootfs" entry when checking for ext4 filesystem.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/misc/e4defrag.c b/misc/e4defrag.c
index 82e3868..0d04df9 100644
--- a/misc/e4defrag.c
+++ b/misc/e4defrag.c
@@ -430,6 +430,8 @@ static int is_ext4(const char *file)
 	}
 
 	while ((mnt = getmntent(fp)) != NULL) {
+		if (mnt->mnt_fsname[0] != '/')
+			continue;
 		len = strlen(mnt->mnt_dir);
 		ret = memcmp(file_path, mnt->mnt_dir, len);
 		if (ret != 0)


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

* Re: [PATCH] Skip "rootfs" entry when checking for ext4 filesystem.
  2009-09-08 16:13 [PATCH] Skip "rootfs" entry when checking for ext4 filesystem Eric Sandeen
@ 2009-10-08 20:14 ` Eric Sandeen
  2010-10-07 17:04   ` Eric Sandeen
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2009-10-08 20:14 UTC (permalink / raw)
  To: ext4 development; +Cc: ravi

Ping on this one?

Ravi reported a failure w/o it:

> Hi,
> 
> I'm playing with e4defrag from e2frprogs git, and I've run into a bug.
> When I try to defragment files on my root filesystem, it refuses to
> acknowledge that the filesystem is ext4. I believe the problem is that
> it checks the filesystem type by parsing /etc/mtab, but the root
> filesystem shows up there like this:
> 
> rootfs on / type rootfs (rw)
> /dev/root on / type ext4 (rw,noatime,barrier=1,data=ordered)
> 
> so it gets confused by the bogus first entry. It works just fine on
> other ext4 filesystems I have.
> 
> (If this is the wrong mailing list, I apologize; I couldn't find one for
> e2fsprogs, so I thought this was the next best thing.)
> 
> --Ravi

Thanks,
-Eric

Eric Sandeen wrote:
> Skip "rootfs" entry when checking for ext4 filesystem.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> diff --git a/misc/e4defrag.c b/misc/e4defrag.c
> index 82e3868..0d04df9 100644
> --- a/misc/e4defrag.c
> +++ b/misc/e4defrag.c
> @@ -430,6 +430,8 @@ static int is_ext4(const char *file)
>  	}
>  
>  	while ((mnt = getmntent(fp)) != NULL) {
> +		if (mnt->mnt_fsname[0] != '/')
> +			continue;
>  		len = strlen(mnt->mnt_dir);
>  		ret = memcmp(file_path, mnt->mnt_dir, len);
>  		if (ret != 0)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [PATCH] Skip "rootfs" entry when checking for ext4 filesystem.
  2009-10-08 20:14 ` Eric Sandeen
@ 2010-10-07 17:04   ` Eric Sandeen
  2010-10-11 20:59     ` Andreas Dilger
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2010-10-07 17:04 UTC (permalink / raw)
  To: ext4 development; +Cc: ravi

On 10/08/2009 03:14 PM, Eric Sandeen wrote:
> Ping on this one?

Ping++

-Eric

> Ravi reported a failure w/o it:
> 
>> Hi,
>>
>> I'm playing with e4defrag from e2frprogs git, and I've run into a bug.
>> When I try to defragment files on my root filesystem, it refuses to
>> acknowledge that the filesystem is ext4. I believe the problem is that
>> it checks the filesystem type by parsing /etc/mtab, but the root
>> filesystem shows up there like this:
>>
>> rootfs on / type rootfs (rw)
>> /dev/root on / type ext4 (rw,noatime,barrier=1,data=ordered)
>>
>> so it gets confused by the bogus first entry. It works just fine on
>> other ext4 filesystems I have.
>>
>> (If this is the wrong mailing list, I apologize; I couldn't find one for
>> e2fsprogs, so I thought this was the next best thing.)
>>
>> --Ravi
> 
> Thanks,
> -Eric
> 
> Eric Sandeen wrote:
>> Skip "rootfs" entry when checking for ext4 filesystem.
>>
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>>
>> diff --git a/misc/e4defrag.c b/misc/e4defrag.c
>> index 82e3868..0d04df9 100644
>> --- a/misc/e4defrag.c
>> +++ b/misc/e4defrag.c
>> @@ -430,6 +430,8 @@ static int is_ext4(const char *file)
>>  	}
>>  
>>  	while ((mnt = getmntent(fp)) != NULL) {
>> +		if (mnt->mnt_fsname[0] != '/')
>> +			continue;
>>  		len = strlen(mnt->mnt_dir);
>>  		ret = memcmp(file_path, mnt->mnt_dir, len);
>>  		if (ret != 0)
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [PATCH] Skip "rootfs" entry when checking for ext4 filesystem.
  2010-10-07 17:04   ` Eric Sandeen
@ 2010-10-11 20:59     ` Andreas Dilger
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Dilger @ 2010-10-11 20:59 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development, ravi

On 2010-10-07, at 11:04, Eric Sandeen wrote:

> On 10/08/2009 03:14 PM, Eric Sandeen wrote:
>> Ping on this one?
> 
> Ping++

Looks reasonable.  I thought it would skip the second "/" entry as well, but in fact this is looking at the "dev" field and it is skipping the "rootfs" (as well as other virtual filesystems like procfs and devfs).

>> Ravi reported a failure w/o it:
>> 
>>> Hi,
>>> 
>>> I'm playing with e4defrag from e2frprogs git, and I've run into a bug.
>>> When I try to defragment files on my root filesystem, it refuses to
>>> acknowledge that the filesystem is ext4. I believe the problem is that
>>> it checks the filesystem type by parsing /etc/mtab, but the root
>>> filesystem shows up there like this:
>>> 
>>> rootfs on / type rootfs (rw)
>>> /dev/root on / type ext4 (rw,noatime,barrier=1,data=ordered)
>>> 
>>> so it gets confused by the bogus first entry. It works just fine on
>>> other ext4 filesystems I have.
>>> 
>>> (If this is the wrong mailing list, I apologize; I couldn't find one for
>>> e2fsprogs, so I thought this was the next best thing.)
>>> 
>>> --Ravi
>> 
>> Thanks,
>> -Eric
>> 
>> Eric Sandeen wrote:
>>> Skip "rootfs" entry when checking for ext4 filesystem.
>>> 
>>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>>> ---
>>> 
>>> diff --git a/misc/e4defrag.c b/misc/e4defrag.c
>>> index 82e3868..0d04df9 100644
>>> --- a/misc/e4defrag.c
>>> +++ b/misc/e4defrag.c
>>> @@ -430,6 +430,8 @@ static int is_ext4(const char *file)
>>> 	}
>>> 
>>> 	while ((mnt = getmntent(fp)) != NULL) {
>>> +		if (mnt->mnt_fsname[0] != '/')
>>> +			continue;
>>> 		len = strlen(mnt->mnt_dir);
>>> 		ret = memcmp(file_path, mnt->mnt_dir, len);
>>> 		if (ret != 0)
>>> 
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

end of thread, other threads:[~2010-10-11 20:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-08 16:13 [PATCH] Skip "rootfs" entry when checking for ext4 filesystem Eric Sandeen
2009-10-08 20:14 ` Eric Sandeen
2010-10-07 17:04   ` Eric Sandeen
2010-10-11 20:59     ` Andreas Dilger

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).