Bug 10543 - Small sized files can result in an allocation size of 0 (zero)
Small sized files can result in an allocation size of 0 (zero)
Status: RESOLVED FIXED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services
unspecified
All All
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-07 09:42 UTC by Björn Baumbach
Modified: 2014-09-03 07:11 UTC (History)
3 users (show)

See Also:


Attachments
proposed patch for 4.1, cherry-picked from master (1.56 KB, patch)
2014-04-07 09:45 UTC, Björn Baumbach
jra: review+
bb: review? (jlayton)
obnox: review+
kseeger: review? (jra)
Details
fix for 4.0, cherry-picked from master (1.56 KB, patch)
2014-04-07 09:46 UTC, Björn Baumbach
jra: review+
bb: review? (jlayton)
obnox: review+
kseeger: review? (jra)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Baumbach 2014-04-07 09:42:33 UTC
I have figured out that files, which are smaller than one block, can be
stored in an inode on some filesystems. I've experienced that on GPFS.
This results in a block size of 0 (zero).

Example:
# echo "some bytes of text" > file.dat
# stat file.dat
  File: `file.dat'
  Size: 19              Blocks: 0

In this case the smbd interprets an allocation size of zero. For clients
this can mean, that a file is an empty sparse file and might not read
any data.
In particular we have seen Windows clients, which load their roaming
profile, and create zero sized files (locally) instead of the expected
small files (as on the server).
Comment 1 Björn Baumbach 2014-04-07 09:45:37 UTC
Created attachment 9835 [details]
proposed patch for 4.1, cherry-picked from master
Comment 2 Björn Baumbach 2014-04-07 09:46:38 UTC
Created attachment 9836 [details]
fix for 4.0, cherry-picked from master
Comment 3 Michael Adam 2014-04-08 12:30:38 UTC
Comment on attachment 9835 [details]
proposed patch for 4.1, cherry-picked from master

ACK. for 4.1
Comment 4 Michael Adam 2014-04-08 12:30:55 UTC
Comment on attachment 9836 [details]
fix for 4.0, cherry-picked from master

ACK for 4.0
Comment 5 Jeremy Allison 2014-05-08 18:45:59 UTC
Re-assigning to Karolin for inclusion in 4.0.next, 4.1.next.
Jeremy.
Comment 6 Karolin Seeger 2014-05-19 10:13:23 UTC
(In reply to comment #5)
> Re-assigning to Karolin for inclusion in 4.0.next, 4.1.next.
> Jeremy.

Jeremy, I this an official ACK for both patches?
Comment 7 Michael Adam 2014-07-18 08:25:04 UTC
Jeremy, this is waiting for a formal review+ from you (other than just assigning) to be pushed...

Thanks - Michael
Comment 8 Jeremy Allison 2014-07-18 16:05:10 UTC
Comment on attachment 9835 [details]
proposed patch for 4.1, cherry-picked from master

LGTM.
Comment 9 Jeremy Allison 2014-07-18 16:05:21 UTC
Comment on attachment 9836 [details]
fix for 4.0, cherry-picked from master

LGTM
Comment 10 Jeremy Allison 2014-07-18 16:05:41 UTC
Re-assigning to Karolin for inclusion in 4.1.next, 4.0.next.
Comment 11 Karolin Seeger 2014-09-01 19:01:36 UTC
Pushed to autobuild-v4-[0|1]-test.
Comment 12 Karolin Seeger 2014-09-03 07:11:03 UTC
Pushed to both branches.
Closing out bug report.

Thanks!