RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 606428 - GFS2: O_TRUNC not working on stuffed files across cluster
Summary: GFS2: O_TRUNC not working on stuffed files across cluster
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Robert Peterson
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-21 15:22 UTC by Nate Straz
Modified: 2010-11-11 16:15 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-11 16:15:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (455 bytes, patch)
2010-06-22 16:35 UTC, Robert Peterson
no flags Details | Diff
Replacement patch (517 bytes, patch)
2010-06-24 23:09 UTC, Robert Peterson
no flags Details | Diff

Description Nate Straz 2010-06-21 15:22:31 UTC
Description of problem:

When a stuffed file (< 512 bytes on GFS2, IIRC) already exists and it opened with O_TRUNC (or creat()) and verified on a separate cluster node, the stat will return a non-zero st_size.

I ran into this while running multiple iterations of dd_io where the test files were not being unlinked between runs.  

A summary of 10 runs of dd_io produced the following results:
------------------------------  pan2 summary --------------------------------
Testcase                                 PASS    FAIL TIMEOUT  KILLED STOPPED
--------                                 ----    ---- -------  ------  ------
d_rwsbufsmall                             10       0       0       0       0 
d_rwranbufsmall                           10       0       0       0       0 
d_rwrevbufsmall                           10       0       0       0       0 
d_rwssyncsmall                            10       0       0       0       0 
d_rwransyncsmall                          10       0       0       0       0 
d_rwrevsyncsmall                          10       0       0       0       0 
d_rwsbuflarge                             10       0       0       0       0 
d_rwranbuflarge                           10       0       0       0       0 
d_rwrevbuflarge                           10       0       0       0       0 
d_rwsynclarge                             10       0       0       0       0 
d_rwransynclarge                          10       0       0       0       0 
d_rwrevsynclarge                          10       0       0       0       0 
d_rwsbufempty                             10       0       0       0       0 
d_rwranbufempty                           10       0       0       0       0 
d_rwrevbufempty                           10       0       0       0       0 
d_rwsyncempty                             10       0       0       0       0 
d_rwransyncempty                          10       0       0       0       0 
d_rwrevsyncempty                          10       0       0       0       0 
d_rwsbufstuffed                            3       7       0       0       0 
d_rwranbufstuffed                          2       8       0       0       0 
d_rwrevbufstuffed                          7       3       0       0       0 
d_rwsyncstuffed                            1       9       0       0       0 
d_rwransyncstuffed                         2       8       0       0       0 
d_rwrevsyncstuffed                         6       4       0       0       0 
--------                                 ----    ---- -------  ------  ------
Totals                                   201      39       0       0       0 

Only the stuffed file test case showed the issue of O_TRUNC not working as expected.

Version-Release number of selected component (if applicable):
kernel-2.6.32-33.el6.x86_64

How reproducible:
Easily

Steps to Reproduce:
1. dd_io -i 10 ...
2.
3.
  
Actual results:
stuffed file test cases fail

Expected results:
all test cases pass

Additional info:

Comment 2 RHEL Program Management 2010-06-21 15:43:27 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Nate Straz 2010-06-21 16:22:15 UTC
I should also note that I discovered this while running w/ jdata enabled.

Comment 4 Nate Straz 2010-06-22 13:07:04 UTC
I ran this against a file system mounted with data=ordered and found that only the buffered and sync stuffed cases failed.  O_DIRECT and mmap methods did not fail.

Comment 5 Robert Peterson 2010-06-22 16:16:11 UTC
I'm pretty sure I see the problem; this will be easy.  I gave
Nate a gfs2.ko to try.  I'll attach the patch shortly.

Comment 6 Robert Peterson 2010-06-22 16:35:08 UTC
Created attachment 426006 [details]
Proposed patch

Here is the patch to hopefully solve the problem.

Comment 7 Robert Peterson 2010-06-23 14:00:15 UTC
I gave Nate a gfs2.ko with this patch yesterday.  I'll just
set the NEEDINFO flag until I hear whether it worked properly.

Comment 8 Robert Peterson 2010-06-24 13:35:36 UTC
My proposed patch doesn't work.  Obviously, i_disksize needs to
be set before the dinode_out.  My bad.  I started testing a
revised patch last night, but ran into a different problem that
warranted investigation.

Comment 9 Robert Peterson 2010-06-24 23:09:05 UTC
Created attachment 426717 [details]
Replacement patch

Here's the one that works.  At least it did on my west cluster.

Comment 11 Aristeu Rozanski 2010-07-01 16:13:39 UTC
Patch(es) available on kernel-2.6.32-42.el6

Comment 14 Nate Straz 2010-07-08 19:31:10 UTC
This is working much better with the -42 kernel.

------------------------------  pan2 summary --------------------------------
Testcase                                 PASS    FAIL TIMEOUT  KILLED STOPPED
--------                                 ----    ---- -------  ------  ------
d_rwsbufstuffed                           10       0       0       0       0
d_rwranbufstuffed                         10       0       0       0       0
d_rwrevbufstuffed                         10       0       0       0       0
d_rwsyncstuffed                           10       0       0       0       0
d_rwransyncstuffed                        10       0       0       0       0
d_rwrevsyncstuffed                        10       0       0       0       0
d_rwdirectstuffed                         10       0       0       0       0
d_rwrandirectstuffed                      10       0       0       0       0
d_rwrevdirectstuffed                      10       0       0       0       0
d_mmapseq_stuffed                         10       0       0       0       0
d_mmaprand_stuffed                        10       0       0       0       0
d_mmaprev_stuffed                         10       0       0       0       0
--------                                 ----    ---- -------  ------  ------
Totals                                   120       0       0       0       0

Comment 15 releng-rhel@redhat.com 2010-11-11 16:15:58 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.