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 228691 Details for
Bug 329431
CIFS with MS-Windows Fileserver: Data loss caused by ignoring quota
[?]
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]
proposed upstream patch 2
cifs-write-behind-rc.patch (text/plain), 5.61 KB, created by
Jeff Layton
on 2007-10-16 12:13:05 UTC
(
hide
)
Description:
proposed upstream patch 2
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2007-10-16 12:13:05 UTC
Size:
5.61 KB
patch
obsolete
>diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c >index abca6b0..fe663c8 100644 >--- a/fs/cifs/cifsfs.c >+++ b/fs/cifs/cifsfs.c >@@ -526,8 +526,11 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, > ssize_t written; > > written = generic_file_aio_write(iocb, iov, nr_segs, pos); >- if (!CIFS_I(inode)->clientCanCacheAll) >- filemap_fdatawrite(inode->i_mapping); >+ if (!CIFS_I(inode)->clientCanCacheAll) { >+ int err = filemap_fdatawrite(inode->i_mapping); >+ if (err) >+ return err; >+ } > return written; > } > >@@ -850,7 +853,7 @@ static int cifs_oplock_thread(void *dummyarg) > struct cifsTconInfo *pTcon; > struct inode *inode; > __u16 netfid; >- int rc; >+ int rc, waitrc = 0; > > set_freezable(); > do { >@@ -882,9 +885,11 @@ static int cifs_oplock_thread(void *dummyarg) > filemap_fdatawrite(inode->i_mapping); > if (CIFS_I(inode)->clientCanCacheRead > == 0) { >- filemap_fdatawait(inode->i_mapping); >+ waitrc = filemap_fdatawait(inode->i_mapping); > invalidate_remote_inode(inode); > } >+ if (rc == 0) >+ rc = waitrc; > } else > rc = 0; > /* mutex_unlock(&inode->i_mutex);*/ >diff --git a/fs/cifs/file.c b/fs/cifs/file.c >index 1e7e4c0..ca91e84 100644 >--- a/fs/cifs/file.c >+++ b/fs/cifs/file.c >@@ -130,7 +130,9 @@ static inline int cifs_open_inode_helper(struct inode *inode, struct file *file, > if (file->f_path.dentry->d_inode->i_mapping) { > /* BB no need to lock inode until after invalidate > since namei code should already have it locked? */ >- filemap_write_and_wait(file->f_path.dentry->d_inode->i_mapping); >+ rc = filemap_write_and_wait(file->f_path.dentry->d_inode->i_mapping); >+ if (rc != 0) >+ CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc; > } > cFYI(1, ("invalidating remote inode since open detected it " > "changed")); >@@ -425,7 +427,9 @@ reopen_error_exit: > pCifsInode = CIFS_I(inode); > if (pCifsInode) { > if (can_flush) { >- filemap_write_and_wait(inode->i_mapping); >+ rc = filemap_write_and_wait(inode->i_mapping); >+ if (rc != 0) >+ CIFS_I(inode)->write_behind_rc = rc; > /* temporarily disable caching while we > go to server to get inode info */ > pCifsInode->clientCanCacheAll = FALSE; >@@ -1336,7 +1340,10 @@ retry: > rc, bytes_written)); > /* BB what if continued retry is > requested via mount flags? */ >- set_bit(AS_EIO, &mapping->flags); >+ if (rc == -ENOSPC) >+ set_bit(AS_ENOSPC, &mapping->flags); >+ else >+ set_bit(AS_EIO, &mapping->flags); > } else { > cifs_stats_bytes_written(cifs_sb->tcon, > bytes_written); >@@ -1468,9 +1475,11 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync) > cFYI(1, ("Sync file - name: %s datasync: 0x%x", > dentry->d_name.name, datasync)); > >- rc = filemap_fdatawrite(inode->i_mapping); >- if (rc == 0) >+ rc = filemap_write_and_wait(inode->i_mapping); >+ if (rc == 0) { >+ rc = CIFS_I(inode)->write_behind_rc; > CIFS_I(inode)->write_behind_rc = 0; >+ } > FreeXid(xid); > return rc; > } >@@ -1521,9 +1530,12 @@ int cifs_flush(struct file *file, fl_owner_t id) > unlock inode for writing > filemapfdatawrite appears easier for the time being */ > >- rc = filemap_fdatawrite(inode->i_mapping); >- if (!rc) /* reset wb rc if we were able to write out dirty pages */ >+ rc = filemap_write_and_wait(inode->i_mapping); >+ /* reset wb rc if we were able to write out dirty pages */ >+ if (!rc) { >+ rc = CIFS_I(inode)->write_behind_rc; > CIFS_I(inode)->write_behind_rc = 0; >+ } > > cFYI(1, ("Flush inode %p file %p rc %d", inode, file, rc)); > >diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c >index ece17ca..b25a542 100644 >--- a/fs/cifs/inode.c >+++ b/fs/cifs/inode.c >@@ -1227,7 +1227,7 @@ cifs_rename_exit: > int cifs_revalidate(struct dentry *direntry) > { > int xid; >- int rc = 0; >+ int rc = 0, wbrc = 0; > char *full_path; > struct cifs_sb_info *cifs_sb; > struct cifsInodeInfo *cifsInode; >@@ -1327,7 +1327,9 @@ int cifs_revalidate(struct dentry *direntry) > if (direntry->d_inode->i_mapping) { > /* do we need to lock inode until after invalidate completes > below? */ >- filemap_fdatawrite(direntry->d_inode->i_mapping); >+ wbrc = filemap_fdatawrite(direntry->d_inode->i_mapping); >+ if (wbrc) >+ CIFS_I(direntry->d_inode)->write_behind_rc = wbrc; > } > if (invalidate_inode) { > /* shrink_dcache not necessary now that cifs dentry ops >@@ -1336,7 +1338,9 @@ int cifs_revalidate(struct dentry *direntry) > shrink_dcache_parent(direntry); */ > if (S_ISREG(direntry->d_inode->i_mode)) { > if (direntry->d_inode->i_mapping) >- filemap_fdatawait(direntry->d_inode->i_mapping); >+ wbrc = filemap_fdatawait(direntry->d_inode->i_mapping); >+ if (wbrc) >+ CIFS_I(direntry->d_inode)->write_behind_rc = wbrc; > /* may eventually have to do this for open files too */ > if (list_empty(&(cifsInode->openFileList))) { > /* changed on server - flush read ahead pages */ >@@ -1479,10 +1483,15 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) > > /* BB check if we need to refresh inode from server now ? BB */ > >- /* need to flush data before changing file size on server */ >- filemap_write_and_wait(direntry->d_inode->i_mapping); >- > if (attrs->ia_valid & ATTR_SIZE) { >+ /* need to flush data before changing file size on server */ >+ rc = filemap_write_and_wait(direntry->d_inode->i_mapping); >+ if (rc != 0) { >+ CIFS_I(direntry->d_inode)->write_behind_rc = rc; >+ /* BB: is this correct, do we want to error out here? */ >+ goto cifs_setattr_exit; >+ } >+ > /* To avoid spurious oplock breaks from server, in the case of > inodes that we already have open, avoid doing path based > setting of file size if we can do it by handle.
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 329431
:
225561
|
225571
|
225581
|
225591
|
225601
|
225611
|
225861
|
226081
|
228691
|
237941
|
259751