Date: Wed, 5 Jan 2005 16:33:13 -0700 (MST) From: Siddharth Aggarwal <saggarwa@cs.utah.edu> To: freebsd-fs@freebsd.org, "" <freebsd-hackers@FreeBSD.org> Subject: write retry on filesystem Message-ID: <Pine.GSO.4.50L0.0501051625560.12638-100000@faith.cs.utah.edu>
next in thread | raw e-mail | index | archive | help
Hi, I have a pseudo disk driver that does a copy on write to a log device. I want to disable further retries to write if the disk space on the log device is full. I have inserted the following code into the strategy routine For this I have set the error code and also set the resid to zero, thinking that the filesystem above will not retry the operation because it assumes that there are no more bytes to be written (since I set resid to 0). However, control keeps coming back to this code, suggesting that the FS (buffer cache) is constantly retrying the operation. Is there any other way to do this (maybe I should try a different error code. I tried ENOSPC too). The reason I want to disable retry is to allow the user to manually select and delete logs to reclaim space and then do the file operation again if he chooses to. The problem arising is because the buffer cache is asynchronously flushed to disk (which could be much after a vfs file write operation). So the application has no way of knowing that a write to disk failed because COW failed due to log device space shortage. So the syncer periodically keeps trying to flush the buffer cache to disk because every time the strategy routine (in my driver which is between the buffer cache and the disk) cannot complete the operation. Any suggestions on how I can accomplish this? Any suggested hack in vfs_bio? Thanks, Sid. strategy () { ..... if (failed < 0) /* no more free space on log device */ { printf ("No more space on disk! Copy on write failed\n"); bp->b_error = EACCES; bp->b_flags |= B_ERROR; bp->b_resid = 0; devstat_end_transaction_buf(&ss->device_stats, bp); biodone(bp); return; } .... }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.50L0.0501051625560.12638-100000>