Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 315202 Details for
Bug 460063
CIFS option forcedirectio fails to allow the appending of text to files.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
upstream proposed patch
0001-cifs-fix-O_APPEND-on-directio-mounts.patch (text/plain), 2.09 KB, created by
Jeff Layton
on 2008-08-28 12:14:47 UTC
(
hide
)
Description:
upstream proposed patch
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2008-08-28 12:14:47 UTC
Size:
2.09 KB
patch
obsolete
>From eecea50662aaaa33b7a9aa7767aa80d722ab7190 Mon Sep 17 00:00:00 2001 >From: Jeff Layton <jlayton@redhat.com> >Date: Thu, 28 Aug 2008 07:54:59 -0400 >Subject: [PATCH] cifs: fix O_APPEND on directio mounts > >The direct I/O write codepath for CIFS is done through >cifs_user_write(). That function does not currently call >generic_write_checks() so the file position isn't being properly set >when the file is opened with O_APPEND. It's also not doing the other >"normal" checks that should be done for a write call. > >The problem is currently that when you open a file with O_APPEND on a >mount with the directio mount option, the file position is set to the >beginning of the file. This makes any subsequent writes clobber the data >in the file starting at the beginning. > >This seems to fix the problem in cursory testing. It is, however >important to note that NFS disallows the combination of >(O_DIRECT|O_APPEND). If my understanding is correct, the concern is >races with multiple clients appending to a file clobbering each others' >data. Since the write model for CIFS and NFS is pretty similar in this >regard, CIFS is probably subject to the same sort of races. What's >unclear to me is why this is a particular problem with O_DIRECT and not >with buffered writes... > >Regardless, disallowing O_APPEND on an entire mount is probably not >reasonable, so we'll probably just have to deal with it and reevaluate >this flag combination when we get proper support for O_DIRECT. In the >meantime this patch at least fixes the existing problem. > >Signed-off-by: Jeff Layton <jlayton@redhat.com> >Cc: stable@kernel.org >--- > fs/cifs/file.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > >diff --git a/fs/cifs/file.c b/fs/cifs/file.c >index ff14d14..cbefe1f 100644 >--- a/fs/cifs/file.c >+++ b/fs/cifs/file.c >@@ -833,6 +833,10 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data, > return -EBADF; > open_file = (struct cifsFileInfo *) file->private_data; > >+ rc = generic_write_checks(file, poffset, &write_size, 0); >+ if (rc) >+ return rc; >+ > xid = GetXid(); > > if (*poffset > file->f_path.dentry->d_inode->i_size) >-- >1.5.5.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 460063
:
314991
|
314992
| 315202