public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v2 1/2] lib: add tst_fs_link_count.c
Date: Thu, 12 Jun 2014 19:32:53 +0200	[thread overview]
Message-ID: <20140612173253.GA5669@rei> (raw)
In-Reply-To: <1402299431-2045-1-git-send-email-wangxg.fnst@cn.fujitsu.com>

Hi!
> +/*
> + * lib/tst_fs_link_count.c
> + * Try to get maximum number of subdirectories under directory @dir in a
> + * mounted file system.
> + * In its implementation, it uses mkdir(2) to create numbers of subdirectories
> + * in @dir, try to reach the limit and will try at most 65535 times. If EMLINK
> + * is hit, we can think the maximum number has been reached, return this number.
> + * Meanwhile under directory @dir: there will be numbers of subdirectories,
> + * Like below:
> + * testdir1, testdir2, testdir3, ..., testdir${returned number}.
> + * If some errors(ENOSPC, EDQUOT) occur or no errors at all, we can think that
> + * the maximum number of subdirectories is infinite or not reachable because
> + * of filesystem's free space, for this case, return 0.
> + * If some other errors occur, we call tst_brkm(TBROK, ...).
> + */
> +int tst_fs_fill_subdirs(void (*cleanup) (void), const char *dir);

This function actually tries to figure out maximal number of elements a
directory can hold (it does not matter if these are files or
directories). So it should be renamed to tst_fs_fill_dir().

Moreover I've been unable to get EMLINK for any filesystem in this case,
it looks like ENOSPC is what you get when maximal number of elemenents
in directory is reached (the free space on filesystem is fine but you
are out of inodes/clusters etc).

I have, slightly modified version of this patch I will commit once this
function is figured out but before I do so I wanted to ask if you plan
to use this function for any testcase? If not I would remove it because
as it is it's not implemented correctly and fixing it would require more
research and effort.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2014-06-12 17:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09  7:37 [LTP] [PATCH v2 1/2] lib: add tst_fs_link_count.c Xiaoguang Wang
2014-06-09  7:37 ` [LTP] [PATCH v2 2/2] linkat/linkat02.c: cleanup Xiaoguang Wang
2014-06-16 14:47   ` chrubis
2014-06-12 17:32 ` chrubis [this message]
     [not found]   ` <539A8784.7010709@cn.fujitsu.com>
2014-06-16 14:05     ` [LTP] [PATCH v2 1/2] lib: add tst_fs_link_count.c chrubis
     [not found]       ` <539F9939.5000505@cn.fujitsu.com>
2014-06-17  7:53         ` chrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140612173253.GA5669@rei \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=wangxg.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox