All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Klotz <peter.klotz@aon.at>
To: reiserfs-list <reiserfs-list@namesys.com>
Subject: reiser4: Request for minor change in max_name_len_cde()
Date: Thu, 16 Feb 2006 17:48:19 +0100	[thread overview]
Message-ID: <43F4ACD3.4090706@aon.at> (raw)

The function max_name_len_cde() in reiser4/plugin/item/cde40.c in my 
opinion limits the file name length too strict.

One finds:

   return
       tree_by_inode(dir)->nplug->max_item_size() -
       sizeof(directory_entry_format) - sizeof(cde_item_format) -
       sizeof(cde_unit_header) - 2;

I think the -2 can be safely changed to -1 since the only extra byte 
that has to be taken into account is the terminating zero of the file 
name in case a longname key is encountered.

The maximum file name length in the original case is 3976 bytes if the 
filesystem uses 4096 byte blocks. In this case the node header of the 
node containing the cde40 item reports 1 byte of free space.

4096   block size
 -28   sizeof(node40_header)
 -38   sizeof(item_header40)
  -2   sizeof(cde_item_format)
 -26   sizeof(cde_unit_header)
 -24   sizeof(directory_entry_format)
  -1   terminating zero of file name
  -1   ?
-----
3976

I changed the -2 to -1 and recompiled the kernel. Then I was able to 
create a file with a 3977 byte name. In this case the node header 
reports 0 bytes of free space.

Best regards, Peter.

             reply	other threads:[~2006-02-16 16:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-16 16:48 Peter Klotz [this message]
2006-02-17 12:32 ` reiser4: Request for minor change in max_name_len_cde() Vladimir V. Saveliev

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=43F4ACD3.4090706@aon.at \
    --to=peter.klotz@aon.at \
    --cc=reiserfs-list@namesys.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 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.